elmarquis / Leaflet.GestureHandling

Brings the basic functionality of Google Maps Gesture Handling into Leaflet. Prevents users from getting trapped on the map when scrolling a long page.
MIT License
275 stars 60 forks source link

Add preventDefault() to avoid page scroll while panning #71

Closed gofr closed 3 years ago

gofr commented 3 years ago

Enabling dragging of a map changes the touch-action CSS property value to prevent the page from scrolling while you are dragging.

However, when dragging is enabled dynamically inside a touch event this CSS change doesn't affect the current gesture.

Add e.preventDefault() in the event handler to prevent the page from scrolling while you're performing a two-finger drag action on the map.

This addresses issue #65

jcroucher commented 3 years ago

Can we get this merged

elmarquis commented 3 years ago

Apologies. I've not been getting a lot of time to look after this plugin. But this fix appears simple and effective. Thank you for the investigation and resolution.