Closed berniesf closed 5 years ago
I found a solution. The line 1260 of the leaflet.draw 1.0.4 contains the following code:
document.addEventListener('touchstart', L.DomEvent.preventDefault, { passive: false });
I replaced that line with
var tempMap = document.getElementById("map");
tempMap.addEventListener('touchstart', L.DomEvent.preventDefault, { passive: false });
Basically instead of preventing the touchstart event on the document, now is applied only to the map object.
Duplicate #922 Another fix: #930
Original issue is not reproduced anymore with new Leaflet 1.6. (Perhaps fixed by https://github.com/Leaflet/Leaflet/pull/6694)
How to reproduce
What behaviour I'm expecting and which behaviour I'm seeing
Minimal example reproducing the issue
I created a jsfiddle and a StackOverflow question:
https://jsfiddle.net/fsv8jegd/2/
https://stackoverflow.com/questions/56030563/leaflet-draw-preventing-click-on-elements-while-is-active