Openstreetmap-website: Some buttons have become less responsive in Safari on Mac

Created on 5 Sep 2020  路  11Comments  路  Source: openstreetmap/openstreetmap-website

Some time over the past couple of days, the Locate, Layers, Legend, Share and Query buttons on the map have stopped responding as reliably in Safari (13.1.2) on my Mac. The other buttons (e.g. zoom, add note) work fine, but these ones seem to require a force touch on the trackpad.

They all work fine still in Chrome.

awaiting upstream bug

Most helpful comment

Could I suggest rolling back to Leaflet 1.6.0?

I realise it's a PITA and we usually track the latest Leaflet release, but osm.org is quite broken in Safari right now - no layer switcher, key, inspect features, shift-drag to zoom, share, or location, plus a couple of minor degradations (e.g. zoom transitions). https://github.com/Leaflet/Leaflet/issues/7255 is not showing any signs of immediate resolution and the 1.6.0->1.7.0 changelog doesn't otherwise seem compelling enough to justify the breakage.

All 11 comments

Presumably yesterday when we upgraded leaflet but there's probably not a lot we can do and certainly nothing with a report as vague as this.

I'll see if I can add any more detail, and/or figure out why some buttons might be behaving differently than others. I thought perhaps the custom OSM tools were behaving differently to the built-in Leaflet ones, but the 'add note' button seems fine.

iOS 13 has the same issue: when pressing the query tool button, I only see a green button for a fraction of a second but nothing else happens. I used to have intermittent issues with those buttons before, with the recent update they seem to be broken now.

@mmd-osm ah yeah, I see that on iOS too. Oddly, it's only the query button that has the issue on there, and the other buttons work perfectly still.

Yes, that鈥檚 exactly what I鈥檓 seeing here, too.

I've replicated part of the issue locally with a simple setup of Leaflet and jQuery.

What seems to be happening is that Safari is emitting two click events for those buttons when clicking them normally, but only one event if force clicking on the trackpad. Chrome only emits one click event as expected, whether clicking normally or with force.

So the first click event in Safari is enabling the tool, and the second is disabling it straight away. That's presumably why the query button flashes green momentarily in iOS. The reason the note tool works is that pressing it a second time doesn't disable it, it just quietly loads it again.

I'll experiment with some alternatives, such as listening for 'pointerdown' instead of 'click' events (which may have unintended side effects) or listening for events using L.DomEvent instead of jQuery.

Maybe worth rolling back to the previous version of Leaflet in the meantime?

Looks like this is now fixed by https://github.com/Leaflet/Leaflet/pull/7260 upstream.

Testing Safari / Mac on a trivial javascript code :

It's definitely a Leaflet issue, but it looks like it will need a little more work before it's fixed.

Could I suggest rolling back to Leaflet 1.6.0?

I realise it's a PITA and we usually track the latest Leaflet release, but osm.org is quite broken in Safari right now - no layer switcher, key, inspect features, shift-drag to zoom, share, or location, plus a couple of minor degradations (e.g. zoom transitions). https://github.com/Leaflet/Leaflet/issues/7255 is not showing any signs of immediate resolution and the 1.6.0->1.7.0 changelog doesn't otherwise seem compelling enough to justify the breakage.

the Locate, Layers, Legend, Share and Query buttons on the map have stopped responding as reliably in Safari

It work only with a right-click 馃槥

Was this page helpful?
0 / 5 - 0 ratings