jwlarocque / svelte-dragdroplist

Sortable lists with Svelte 3. Animated, touch-friendly, and accessible.
114 stars 24 forks source link

grab not released on mouse up outside dragdroplist #6

Open helbling opened 3 years ago

helbling commented 3 years ago

steps to reproduce:

expected:

what happens instead:

edit: tested with desktop Chrome and Firefox using a mouse, seems to work fine with touch events on mobile Chrome and Firefox

ianengelbrecht commented 3 years ago

Yes, I got this too on the simple example repl. Drag an item to the bottom of the list and drop and it 'sticks' to the mouse pointer.

jamersoniiv commented 3 years ago

I get this too, has anyone found a fix or workaround?

Roger-Sa commented 3 years ago

Adding this in the component works:

https://svelte.dev/repl/03dc6af80d0e4507abbbe80aad079fa5?version=3.43.1

jamersoniiv commented 3 years ago

Adding this in the component works:

https://svelte.dev/repl/03dc6af80d0e4507abbbe80aad079fa5?version=3.43.1

Hice Roger-Sa, I had added an on:mouseleave event to the List div, which worked to cancel the drag when you left the div, but your solution is much more as I would expect it to behave.

So thanks for sharing!