-
Notifications
You must be signed in to change notification settings - Fork 2.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
Marker with a
element does not open the url when clicked
#6730
Comments
Can't reproduce, for me it works. Chrome 65.0.3325.181 on Linux |
Works for me too. @exotfboy is that the right example? |
I am sure I can not open none of the links when I post this issue, but now I found that the link can be opened sometime(not all). I will tried to make a video to verify that. |
I was able to reproduce this with Google and Firefox. When clicking about 50 times, there is one click which doesn't do anything. |
Now when the example has been open a while, it seems that the probability to get a "broken link" is much higher. It is easier to reproduce this with Chrome. |
Also when you click the map, you will find that the position of the marker is changed a little. The same occurs when you drag the map. I suspect that sometimes the click is considered as starting and stopping the dragging instead of clicking the link. |
If you move the mouse between the mousedown and the mouseup, it's interpreted as a map drag rather than a click event. I suspect that's what's happening. If you don't want to allow dragging the map via the marker element:
|
I've also reopened #1832 -- if you are interested in adding a click tolerance option, we'd welcome a PR. |
The issue can definitely be reproduced although the mouse doesn't move at all. For some reason, it is considered as drag start. |
I can reproduce a browser bug in Chrome that would cause this: https://bugs.chromium.org/p/chromium/issues/detail?id=721341 I guess the drag handler needs to filter out spurious move events. |
As @ttsirkia said, the link can not be opened even I do not move the mouse. |
I tried this tool https://dvcs.w3.org/hg/d4e/raw-file/tip/mouse-event-test.html but couldn't get any spurious mousemove events. |
That confirms the root cause. For some reason, it occurs more often for you. And I'm still wondering why I couldn't see the behavior with that tool. |
Thank you guys for the insistence of finding the root cause for this unusual issue. |
version: 0.45.0
When add marker(
a
element) to map, and click the marker. A new page with thehref
of the marker element should be opened, but nothing happened.https://jsfiddle.net/8z8vukk0/
Try to click the red marker.
Also when you click the map, you will find that the position of the marker is changed a little.
The text was updated successfully, but these errors were encountered: