-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Selection callback #22
Comments
I agree this would be nice. I think triggering custom events on the typeahead input is the best way to go about this. Thoughts? |
Sorry, i missed your point in my previous answer. (deleted it) Yes, you are right, a custom event could be a nice implementation. |
there is any way to listen using the .on method in EventTarget? |
Nope, that's used for stuff internal to typeahead.js. |
Thanks @jharding ! |
…m) to dataset and also a 'selection' event that fires when an item is selected.
+1 =) |
It would be nice to have a simple way to set a custom callback when a suggested item is selected.
I expect something like:
selectCallback : function(typeaheadItem, selectedItem){ .... }
where
This way it would be easier to user other properties/attributes of the selected item (not only the value property) when something is selected.
The text was updated successfully, but these errors were encountered: