-
Notifications
You must be signed in to change notification settings - Fork 179
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
result event is invoked twice #99
Comments
This is an upstream issue in suggestions, see tristen/suggestions#13 |
This is causing issues for me in a situation where I am trying to animate some layers that contain the resulting point of a geocode operation. Since the result is invoked twice, my animation runs twice and looks weird. Any ideas for a workaround appreciated. |
@brambow Do you mind testing the proposed solution at tristen/suggestions#13
I didn't notice any issue, if you don't either we can try to get a fix for this! |
Yep. That seems to fix it. |
This also fixed it for me as well. |
Just noting that removing this code does fix it for modern browsers but breaks it for IE11. tristen/suggestions#13 (comment) |
Throwing in my request for a fix as well (preferably one that satisfies IE11). My current solution is to set up global to store the
|
Using GL JS The second |
That's interesting, I'm also running Chrome on Linux and can't replicate that, in fact I'm only ever seeing the result event emitted once. 🤔 |
@andrewharvey sometimes I also see only one result event. It seems like it depends on
With the following steps I get always a second result event after a click with the left mouse button (just noticed that the click must not be necessarily on the map, e.g. a click on the console triggers also the 2nd event):
|
@pathmapper Right, that's because hitting enter selects the result, but doesn't blur the input, only when you click the map does the input blur and it triggers result again. I believe that points back to tristen/suggestions#13 where the issue was ensuring result is triggered in all interactions (keyboard, mouse) across all supported browsers (IE11 was the issue), it was easy to fix for modern browsers, but I couldn't find a way to fix it such that it didn't break IE11. |
Deduplicate result event emissions (#99)
#218 implemented a workaround the underlying bug in the upstream suggestions library. So I'll go ahead and close this as the bug shouldn't be noticeable to end users anymore. This is slated for v4 release. |
http://jsbin.com/nalopux/edit?html,console,output
If I type something in the Geocoder then select an option, the
result
event is seemingly invoked twice with the same result.The text was updated successfully, but these errors were encountered: