Open doubotis opened 7 years ago
Same issue here :)
same here
I have the same issue. There is already an issue for that: https://github.com/Leaflet/Leaflet.draw/issues/695 There is also an workaround (overriding the L.Draw.Polyline.prototype._onTouch) included which works fine for me.
How to reproduce
What behaviour I'm expecting and which behaviour I'm seeing
Minimal example reproducing the issue
Try to pan the map when in drawing mode. Your example: http://leaflet.github.io/Leaflet.draw/docs/examples/full.html
Old version, expected behavior: https://jsfiddle.net/user2314737/Lscupxqp/
Additional information
This behavior was not observed in previous versions (with Leaflet 1.0.0 / L.Draw 0.2.3 it seems to work well)
I've searching in the code and it appears touchstart event is called before mouse events. That means mouseup/mousedown events are "ignored". Well, okay, but why touchstart event triggers the adding of a node? The node must be added when touchend triggers, not before.
I tried to add a "touchend" event on the map, but seems that doesn't work.
map.on("touchend touchcancel", function(e) { console.log(e); });
doesn't log anything.Maybe an issue with Leaflet itself ?