Autoswitch handles for edges #631
-
Hi, I have a question. I have custom node with 4 source handles (on top, right, bottom and left of node, green color) and same for target handles (red color). When I connect two nodes by hands, for example left source handle and right target handle everything looks fine. But when I drag node to the opposite side I want that edge automatically changed handles, that it connected to. Can it be achieved? I can calculate which handles should be used, but I don't understand which event should I listen to, where to listen it, and probably how to tell vue-flow to redraw edge? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Mh... I haven't tried this yet, but I would assume
The edge should be redrawn, whenever you change |
Beta Was this translation helpful? Give feedback.
Mh... I haven't tried this yet, but I would assume
onNodeDrag
so you can calculate the closest handle when a node's position changesedge.sourceHandle
oredge.targetHandle
when there is a new closest handle.The edge should be redrawn, whenever you change
sourceHandle
ortargetHandle
.