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

[bug] Removing an element while it is dragged throws an error #1943

Open
wdoug opened this issue Oct 8, 2020 · 0 comments
Open

[bug] Removing an element while it is dragged throws an error #1943

wdoug opened this issue Oct 8, 2020 · 0 comments

Comments

@wdoug
Copy link

wdoug commented Oct 8, 2020

Reproduction

Scenario

https://codesandbox.io/s/still-wildflower-qugs0?file=/src/index.js

Steps to Reproduce

Summary of steps if applicable.

  1. Drag any of the elements on the page
  2. Wait for that element to be removed
  3. See error thrown

Describe the bug

An error is thrown. This in turn can create cascading issues where elements aren't removed or updated properly or break other libraries that use this one (example from react-sortablejs).

Expected behavior

Version

package version
sortablejs ^1.12.0
@types/sortablejs N/A

Additional Context

I would expect when an element that you are dragging is removed it would immediately be removed from the DOM the drag would be canceled. This is what happens with jquery-ui's Sortable implementation (which happens to be the legacy UI that we are trying to replace with Sortablejs). I don't know if jQuery-UI supports HTML5 drag and drop though, so I'm not sure how useful referencing their implementation is.

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

1 participant