Drag handles of a nested container also drag the parent container.
See original GitHub issueI have a nested container setup where both the parent elements and the child elements use handles. However, the drag handles of the children elements also drag the parent elements around (the first child handle will drag the first parent, while the second child element will drag the second parent element no matter which child container the child element is in).
I looked into the source code, and it looks like the SortableContainer.handleStart
fires for both containers and they each search for the closest node with sortableInfo
on it, which finds the child element. However, the containers do not check if that node is actually part of its collection.
A quick hack I found that fixes it is to add the manager
to the sortableInfo
field on the node: node.sortableInfo = { index, collection, manager: this.context.manager };
. The handleStart
method then checks this against its own manager: if (node.sortableInfo.manager != this.manager) { return; }
.
If you want, I can submit a pull request with this, or a related fix. Just let me know!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top GitHub Comments
@clauderic Hey, sorry I was out of town for a few days. If you haven’t started this yet, I can get it done on Thursday.
Just released
0.4.10
with this fix! Again, thanks @DeadHeadRussell for taking the time to submit a PR for this ❤️