-
Notifications
You must be signed in to change notification settings - Fork 19
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
change event emitted twice #13
Comments
The bit I'm missing is this extra code ensures the event fires on IE11. Without it IE11 won't emit the change event. 🤔 |
The other think I'm missing is that this duplicate only fires when changing to something different. If you the demo you choose "Roy Hargrove", then delete and select it again, it won't duplicate. So the scenarios are:
I think given the inconsistancies of the native events, it might be better to have users and gl-geocoder not listen on the native change event, but instead rely on an event Suggestion fires, and get suggestions to fire on scenario 3. |
In the "Example with options" at http://tristen.ca/suggestions/demo/ if you select a value from the list the
change
event is called twice. (though it seems if you reselect the same value again it is only called once.If I disable the dispatch of the change event at https://github.com/tristen/suggestions/blob/gh-pages/src/suggestions.js#L151 the event is only triggered once and there doesn't seem to be any side affects.
So what am I missing? Why is the event dispatched? Can we just remove it?
This affects the mapbox-gl-geocoder per mapbox/mapbox-gl-geocoder#99.
The text was updated successfully, but these errors were encountered: