Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grab not released on mouse up outside dragdroplist #6

Open
helbling opened this issue Feb 28, 2021 · 4 comments
Open

grab not released on mouse up outside dragdroplist #6

helbling opened this issue Feb 28, 2021 · 4 comments

Comments

@helbling
Copy link

helbling commented Feb 28, 2021

steps to reproduce:

  • grab an element using the mouse
  • move pointer outside dragdroplist
  • release mouse press

expected:

  • element would be released where it last was moved
  • element should not follow the pointer again when moving the pointer back into dragdroplist

what happens instead:

  • element is still in grabbed state
  • follows the pointer again when moving the pointer back into dragdroplist

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

@helbling helbling changed the title grab not released on pointer up outside dragdroplist grab not released on mouse up outside dragdroplist Feb 28, 2021
@ianengelbrecht
Copy link

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
Copy link

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

@Roger-Sa
Copy link

Roger-Sa commented Oct 6, 2021

Adding this in the component works:
<svelte:window on:mouseup={release} on:touchend={release} />

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

@jamersoniiv
Copy link

Adding this in the component works: <svelte:window on:mouseup={release} on:touchend={release} />

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants