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 -- Incorrect indicies being returned onSelect / onDeselect #2021

Closed
kevannguyen opened this issue Mar 30, 2021 · 1 comment
Closed
Labels
bug MultiDrag Relating to the MultiDrag plugin

Comments

@kevannguyen
Copy link

When multidragging items, the sortable event that's passed onSelect and onDeselect will sometimes return a list of incorrect selected indexes. An erroneous list of selected indexes will generally consist of a list of "-1" values, e.g. [-1, -1, -1, -1].

To Reproduce
Steps to reproduce the behavior:

  1. Go to code sandbox -- may have to refresh the sandbox browser on load for code to run.
  2. Select 3+ items and then multidrag anywhere in the list. Repeat this step until it displays an erroneous list of indexes in the browser e.g. [-1, -1, -1, -1]

Expected behavior
Expect the returned indexes to be correct and not full of -1 values as indexes.

Information

Versions - Look in your package.json for this information:
sortablejs = ^1.11.2-alpha.4
@types/sortablejs = ^1.10.6 // Using javascript for sandbox demonstration. But personal project uses typescript.

Reproduction
codesandbox: https://codesandbox.io/s/sortablejs--multidrag-incorrect-indexing-dnrni?file=/src/index.js

@owen-m1 owen-m1 added the bug label Apr 3, 2021
@owen-m1 owen-m1 added the MultiDrag Relating to the MultiDrag plugin label May 2, 2021
owen-m1 added a commit that referenced this issue May 2, 2021
@owen-m1
Copy link
Member

owen-m1 commented May 2, 2021

Fixed in commit e83eb7e

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

No branches or pull requests

2 participants