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

Fix for multidrag taking wrong new index on update/add #2

Open
wants to merge 3 commits into
base: multidrag
Choose a base branch
from

Conversation

codetakki
Copy link

Thank you for adding the multidrag support!

This PR fixes a bug where dragged items would take the "new index" from the item that started the drag, witch results in the new index being offset by that item:
Order befor drag:
Screenshot from 2024-05-15 13-12-02
Order after grabbing the last item and moving it to the top:
Screenshot from 2024-05-15 13-12-13

I found that the functions that update on multi used the "newIndex" key to determine the starting index for the rest of the items.
Instead, i suggest taking the first item in the "newIndicies" array as a starting point

@codetakki codetakki marked this pull request as ready for review May 15, 2024 11:18
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

Successfully merging this pull request may close these issues.

1 participant