L.Draggable._dragging stuck
See original GitHub issueHow to reproduce
- Leaflet version I’m using: //cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0/leaflet.js
- Browser (with version) I’m using: FF 49.0.2
- OS/Platform (with version) I’m using: Ubuntu 16.04
I have a temporary draggable markers that appear over a feature (on hover) and unless are dragged - I disappear them should the mouse hover away. Unless dragged, i.e.: unless they received ‘dragstart’. When i drag them real quick however (for some reason reproduces more easily on FF - seems slower) then the following happens:
L.Draggable._onDown
sets the globalL.Draggable._dragging = true;
mousemove
reaches my code and at this point:- I haven’t received ‘dragstart’ yet.
- the mouse is far enough for me to decide to remove the marker
- I remove the marker and
L.Draggable._onUp
is never called leavingL.Draggable._dragging
rot in its sorry state forever.
Obviously the offending consequence is that nothing can be dragged ever. Understanding what’s cooking I have a workaround, so no rush with this.
To see for youself: https://playground-leaflet.rhcloud.com/qaha/1/edit?html,output
start dragging the marker and do not stop until it disappears. When it disappears the map is not draggable/panable.
What behaviour I’m expecting and which behaviour I’m seeing
I would expect the code be more resilient to this scenario - more specifically:
- if a draggable is being removed amidst a drag it should clear
L.Draggable._dragging
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
L.Draggable._dragging stuck · Issue #5063 · Leaflet ... - GitHub
I have a temporary draggable markers that appear over a feature (on hover) and unless are dragged - I disappear them should the...
Read more >Leaflet map marker dragging is not working properly on ...
I updated the codepen and added back the dragging: !L.Browser.mobile and it disables scroll on my mobile and lets me drag the marker....
Read more >Dragging a draggable element out of a scrollable div - GSAP
The dragging gets initiated, but gets stuck and just stops. I'm not quite sure yet what's causing the error, but I'm going to...
Read more >Mouse Gets Stuck in Drag Mode on Map : r/X4Foundations
Sometimes when I'm dragging the map around, the mouse won't release so that any movement keeps dragging the map even though I'm no...
Read more >Leaflet map draggable marker events - GIS Stack Exchange
Edit: marker.on('click', L.DomEvent.stopPropagation); This partially fixes the bug. Now if I drag the marker VERY quickly and release it, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@landonreed Please open a new issue, clearly explaining what you mean by “unintended” and “some issues I’m running into”. Reproducible examples, etc.
@perliedman, I think this bug fix might cause unintended results for some users of Leaflet. Is my understanding correct that if the marker being dragged is changed while dragging the
this
reference will no longer equalL.Draggable._dragging
and causefinishDrag
to fire?I’ve been working on updating to Leaflet 1.0.2 and think this bug fix is the source of some issues I’m running into. Should I open a new issue?