Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Handler for Autocomplete and Click Off #93

Open
BerocLOD opened this issue Nov 1, 2019 · 0 comments
Open

Event Handler for Autocomplete and Click Off #93

BerocLOD opened this issue Nov 1, 2019 · 0 comments

Comments

@BerocLOD
Copy link

BerocLOD commented Nov 1, 2019

Can you include some changes that will help event handling with validation?

I added a local method to handle updates
// update method for autocomplete function update() { $(this).niceSelect("update"); }

In the create_nice_select method, I added a binding that will call that local method when the select is changed:
$select.bind("change", update);

I unbound it back up in the string method handler (so when you call the destroy method:
$select.unbind("change", update);

lastly, I added the blur functionality to the part when you close when clicking outside.
$('.nice-select').prev('select').trigger('blur');

Thanks,
Robert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant