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

abort sortleave event #790

Open
giacomomasseron opened this issue Jul 16, 2021 · 8 comments
Open

abort sortleave event #790

giacomomasseron opened this issue Jul 16, 2021 · 8 comments

Comments

@giacomomasseron
Copy link

Is there the chance to abort the sortleave event and avoid an item from being removed from the list?

@lukasoppermann
Copy link
Owner

Hey, there is no specific functionality for this. But you should be able to add it to the sortleave event handler.

Did you try a simple event.preventDefault()?

@firanto
Copy link

firanto commented Sep 26, 2021

Hey, there is no specific functionality for this. But you should be able to add it to the sortleave event handler.

Did you try a simple event.preventDefault()?

I've tried to do it as you've said (calling event.preventDefault() on sortleave event). The dragged item is still lost forever (it didn't back to its original position before it is dragged).

@lukasoppermann
Copy link
Owner

Hmm, in this case it is really missing. Would you be able to send a PR that adds this functionality?

@ac615223s5
Copy link

ac615223s5 commented Mar 24, 2022

how do you prevent the item from being removed in your demo?

@lukasoppermann
Copy link
Owner

@ZZaria what specifically are you referring to?

@ac615223s5
Copy link

ac615223s5 commented Mar 24, 2022

https://lukasoppermann.github.io/html5sortable/index.html in the first sortable list, the element doesn't disappear when dragged off, it just returns to its original postion when the mouse is released
image

@zhixXiang
Copy link

any update?

@lukasoppermann
Copy link
Owner

No. But I am very happy to accept a PR if you are able to send one.

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

5 participants