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] MultiDrag Plugin: onSort event not fired on certain interaction #2203

Closed
roy-mdr opened this issue Sep 12, 2022 · 0 comments
Closed

[bug] MultiDrag Plugin: onSort event not fired on certain interaction #2203

roy-mdr opened this issue Sep 12, 2022 · 0 comments

Comments

@roy-mdr
Copy link

roy-mdr commented Sep 12, 2022

Describe the bug

When using the MultiDrag plugin and dragging from an element which index doesn't change on drop (before all the other elements are moved), the onSort event won't be fired even though all other elements changed position (ended up being consecutive), tho changing the list order, tho expecting the onSort event to be triggered.
If the element selected for dragging changed its relative position, even dropping on the same place, it will trigger the onSort event (expected behavior).

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://jsbin.com/faviwab/edit?html,js,output (or create a basic Sortable with MultiDrag plugin enabled)
  2. Select (click) the first and last item ("This is Sortable" and "...out of the box.")
  3. Either drag the first selected element to be the first item in the list or the last element to be the last from the list
  4. The items will sort to new position (the selected items will end up together)
  5. But NO alert will be thrown.

Expected behavior

There is an alert when the onSort event is triggered, however doing this won't trigger the onSort event.

  1. Select (click) the first and last item ("This is Sortable" and "...out of the box.")
  2. Either drag the first selected element to be the LAST item in the list or the last element to be the FIRST from the list
  3. The items will sort to new position (the selected items will end up together)
  4. An alert will be thrown, so the onSort event was triggered correctly.

Versions:
sortablejs = 1.15.0

Additional context

...

Reproduction
codesandbox: https://jsbin.com/faviwab/edit?html,js,output

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

2 participants