fix: set focus on action when edge is updated
This commit is contained in:
parent
7c6077ded5
commit
e7a5c2282d
1 changed files with 10 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ const {
|
|||
onNodeDragStop,
|
||||
onConnect,
|
||||
onEdgeUpdate,
|
||||
onEdgeUpdateEnd,
|
||||
addNodes,
|
||||
addEdges,
|
||||
setEdges,
|
||||
|
|
@ -155,6 +156,15 @@ onConnect(edge => {
|
|||
});
|
||||
});
|
||||
|
||||
onEdgeUpdateEnd(({ edge }) => {
|
||||
getSelectedNodes.value?.forEach(node => (node.selected = false));
|
||||
if (edge.source.startsWith("action-")) {
|
||||
setTimeout(() => (findNode(edge.source).selected = true));
|
||||
} else if (edge.target.startsWith("action-")){
|
||||
setTimeout(() => (findNode(edge.target).selected = true));
|
||||
}
|
||||
})
|
||||
|
||||
onEdgeUpdate(({ edge, connection }) => {
|
||||
if (
|
||||
(connection.source == edge.source && connection.target != edge.target) ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue