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

payload.toIndex is incorrect #36

Open
ftruzzi opened this issue May 21, 2020 · 1 comment
Open

payload.toIndex is incorrect #36

ftruzzi opened this issue May 21, 2020 · 1 comment
Labels
question 🤔 Further information is requested

Comments

@ftruzzi
Copy link

ftruzzi commented May 21, 2020

When moving an item to a different container, the toIndex property can be incorrect (maybe when moving over different items on the target list before releasing?)

Below, toIndex should be 1 but it is 3.

https://codesandbox.io/s/muuri-react-toindex-ku5fb?file=/utils.js

image

Thanks!

@paol-imi paol-imi added the question 🤔 Further information is requested label May 22, 2020
@paol-imi
Copy link
Owner

I will investigate further, I don't know if it is a problem with Muuri or with Muuri React.

For now if you need the index you can use
toGrid.getItems().findIndex(item => item._component.key === key)
(toGrid is in the payload)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question 🤔 Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants