onDrop returning invalid addedIndex and removedIndex
ouroboroscoding opened this issue · 1 comments
Is there any way to identify containers or draggables uniquely so they don't increment each others index counts?
I have a set of Draggables in a parent Container, that themselves have Containers with child Draggables. There is no connection between the two whatsoever, it's just a tree of data, and each child branch can be re-ordered with it's sibling branches, just as each parent branch can be re-ordered with it's sibling branches.
I have given each container a unique group name, and even given each a unique dragHandleSelector, and yet when I drag anything other than the first parent, I get bad indexes from onDrop.
For example, if I try to move the 0 child in the 0 parent to the 1 index, instead of getting a removedIndex of 0 and a addedIndex of 1, I end up with 1 and 2 respectively, as if the 0 parent is 0, and the 0 child is 1, and the 1 child is 2. I get this on some level, but it makes it very hard to order the elements correctly without knowing just how many total draggables are open and adjusting accordingly. It would be much better if the containers themselves could keep track of this and not attribute draggables that are more than a level down to the total indexes.
On more research it seems to always be 1 off, so it's actually manageable, but still a bug I think.