-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Leaflet 1.7.1 causes 2 click events to be emitted by Leaflet Controls in Safari #7255
Comments
For the sake of clarity: that example is using
|
This comment has been minimized.
This comment has been minimized.
The simulated event comes from Leaflet/src/map/handler/Map.Tap.js Line 100 in 4f32a5e
So I suggest changing the condition at Leaflet/src/map/handler/Map.Tap.js Line 87 in 4f32a5e
into something like if (this._fireClick && e && e.changedTouches && !(Browser.safari && !Browser.mobile)) { However, I do not own any Apple hardware (at the moment), so I'm unable to test this; and I don't know if this might impact previous versions of desktop Safari, or other browsers (Does the bug maybe reproduce on firefox mobile?). |
I think this bug has been introduced at https://github.com/Leaflet/Leaflet/pull/7010/files#diff-c2e3d5ef35bf1c4a7c6b549ddf734725R134 @johnd0e , can you have a look? Maybe you introduced that change to account for iOS but unintentionally affected desktop macOS? |
Thanks for looking into it @IvanSanchez. I'm happy to help testing any proposed changes on Safari on Mac or iOS. Just to add, there is a related problem in Safari on iOS, but it seems to behave slightly differently. I haven't done much testing on that. |
That was definitely meant to address iOS issues, see discussion: #7010. Possible quickfixes:
But what if tomorrow we will get macbook with touchscren? That will break it all again. |
So I propose to apply quickfix ( |
I like this approach (as a "quick & dirty" fix).
You know that my answer, in the end, is gonna be #7200 :-) |
Unsure whether this is the same issue (so please forgive tagging onto end of existing ticket), but shift-drag to zoom in is also broken in 1.7.1 on desktop Safari. Happy to open a new issue if #7260 hasn't fixed this too. |
@systemed Can you please try shift-dragging using https://s3.amazonaws.com/leafletjs-cdn/content/leaflet/master/leaflet-src.js ? (e.g. https://plnkr.co/edit/v4GzrCYSxpIO1aOo ) That's a build from |
Spot on - that works fine. 👍 |
As appeared, the same issue affects not only desktop Safari, but also legacy Edge (and who knows what else). So... May be we should change |
I've updated my codepen to use the code built from master, and also to display the events to make it easier to test on mobile. It's working well on desktop Safari, but unfortunately, it looks like mobile Safari is still firing off two click events. |
If the JS at https://s3.amazonaws.com/leafletjs-cdn/content/leaflet/master/leaflet-src.js is the latest version, it's still firing two click events on iOS Safari. |
@dagjomar It may be different issue. Because on Leaflet/src/map/handler/Map.Tap.js Line 43 in dda26ba
And I do not see any reason why that might not work. |
@johnd0e I'll see if I can get some more details out, and let you know. Would it make a difference what type of element was used (e.g. |
I've updated the codepen to log some simplified event details to the console on there. The events on iOS seem to be the same as seen on the desktop before this update:
Also, Let me know if there's anything else you'd like me to try @johnd0e? |
Is it possible that the following lines aren't needed, if Safari is firing its own click events? Leaflet/src/map/handler/Map.Tap.js Lines 98 to 101 in 4f32a5e
|
Adicionado a opção "tap: false", para solucionar um bug Leaflet/Leaflet#7255
This bug is also reproducible on Leaflet 1.7.1 on Gnome Web (Epiphany). |
please release 1.7.2 with this fix |
@AduchiMergen we are currently in the final phase before releasing 1.8.0. We think we release it with march |
@Falke-Design The 1.8 is quite big update which includes breaking changes |
If 1.8.0 includes breaking changes, why isnt it a 2.0.0 release then?? |
It has very minor breaking changes that shouldn't affect most codebases, and NPM doesn't upgrade minor versions anyway. v2.0 will have more substantial changes like dropping support for old IE. |
Any updates on ETA? I just spent 30 minutes debugging this only to stumble upon this issue after tracing it back to the |
@SpencerKaiser can you try |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
ETA a few days. Very likely at the end of the week. |
Edit: Thanks for making the one above on topic again 😉 |
👮 |
safari is unable to open the map markers. Known issue : Leaflet/Leaflet#7255 (comment) Fixed in the later versions of leaflet. Now using v 1.9.4.
Steps to reproduce
Steps to reproduce the behavior:
isTrusted:true
and another withisTrusted:false
attributes(Using 'force touch' to click the button on a trackpad results in only a single click event being emitted, but it also triggers the Safari preview popup.)
Expected behavior
There should only be one click event emitted, with the
isTrusted:true
attribute.Would Leaflet be able to safely filter out the click events with
isTrusted:false
?Current behavior
In version 1.6 the expected behaviour is observed. In version 1.7.1 Chrome exhibits the expected behaviour, but Safari doesn't.
The differences between the two events are included below.
MouseEvent 1:
MouseEvent 2:
_simulated
,composed
,isTrusted
and perhapswebkitForce
seem to be the key differences, but it also seems odd that there are different timestamps and Y dimensions between the two events.Environment
Additional context
I noticed this after OpenStreetMap updated to the latest version of Leaflet, where the issue manifests itself by preventing some of the map tools to be used as the first event toggles a tool on and the second toggles it off. Related issue posted at openstreetmap/openstreetmap-website#2811
Minimal example reproducing the issue
Please see https://codepen.io/dankarran/pen/JjXMXzd
The text was updated successfully, but these errors were encountered: