-
Notifications
You must be signed in to change notification settings - Fork 984
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
Drag handles of a nested container also drag the parent container. #112
Comments
Just starting now to integrate |
I have the exact same issue. A fix would be much appreciated. |
I would love to have such a fix: my uber-nested handles are starting dragging even siblings of their own parents! |
@DeadHeadRussell are you still interested in submitting a PR for this? If not I'll take a look within the next couple of days |
@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 |
I 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 withsortableInfo
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 thesortableInfo
field on the node:node.sortableInfo = { index, collection, manager: this.context.manager };
. ThehandleStart
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!
The text was updated successfully, but these errors were encountered: