Open henrymgarrett opened 3 years ago
I believe this is the issue:
const onDragEnd = () => {
if (dragNode && enteredNode && canLinkNode && dragNode.parent !== enteredNode.id) {
onNodeLink(dragNode, enteredNode, dragPort);
}
Note the dragNode.parent !== enteredNode.id
condition - i will remove this but need to do some testing first.
@amcdnl Thanks so much. Let me know when it is deployed and I will update my version 👍
done in latest.
@amcdnl Is the code you typed out above from one of the drag hooks? I updated to the latest, and am implementing dragging myself, but I do not get onNodeLink
called even when I return true from onNodeLinkCheck
I'm submitting a...
Current behavior
onNodeLink is not called for children of nested nodes.
Slightly longer explanation: When I have two nested nodes, each with child nodes, and I try to draw an edge between child nodes of different parents (in the picture, Child 1.2 -> Child 2.1), onNodeLinkCheck is called, but onNodeLink never gets called. I have verified that I return true from onNodeLinkCheck for these two child nodes.
Expected behavior
The desired behavior is that no matter the nodes, if onNodeLinkCheck returns true, onNodeLink should be called
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
In my application, I only allow linking of parent nodes, so I need to be able to detect if a user is starting/completing an edge from anywhere in a nested node. Currently, the solution works if I do link dragging on the excess space between the child node border and inside of the nested parent border, but that is not intuitive to the user.
Environment