SortableJS / react-sortablejs

React bindings for SortableJS
http://sortablejs.github.io/react-sortablejs/
MIT License
2.06k stars 210 forks source link

I'm having difficulty swaping items between two lists in a group. #208

Open JHCover opened 3 years ago

JHCover commented 3 years ago

The items will swap positions with each other if they're in the same list, but when I try to swap items, using the swap plugin, between two lists I get this error: NotFoundError: Node.insertBefore: Child to insert before is not a child of this node

here's an example: https://codesandbox.io/s/stupefied-bash-g3kww?file=/src/App.js

Am I doing something wrong or is this not possible at the moment?

Reg93 commented 1 year ago

I also have a problem with Swap. It works incorrect between groups, but inside groups it works right. In console levels are right, but it renders wrong.

https://codesandbox.io/s/relaxed-wing-j49qd7?file=/src/App.js

ADTC commented 1 month ago

@JHCover @Reg93 It looks like using a group of multiple lists will NOT work with the Swap plugin. You have to the disable Swap plugin, unfortunately. (I would consider this as a bug, as theoretically it should work.)

This is an example of multi-list without swap. Items can only be re-ordered, not swapped, but they can move between lists.

PS: @Reg93 it looks like your sandbox is an empty project. Is that intentional?