Skip to content

Commit 56eb94e

Browse files
authored
fix(core): correct connection keys (#1749)
* fix(core): correct connection keys Signed-off-by: braks <[email protected]> * chore(changeset): add Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]>
1 parent e94611a commit 56eb94e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/strong-buttons-wink.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/core": patch
3+
---
4+
5+
Correct connection keys.

packages/core/src/utils/store.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ export function updateConnectionLookup(connectionLookup: ConnectionLookup, edgeL
171171
const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge
172172

173173
const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle }
174-
const sourceKey = `${sourceNode}-${sourceHandle}`
175-
const targetKey = `${targetNode}-${targetHandle}`
174+
const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`
175+
const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`
176176

177177
addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle)
178178
addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle)

0 commit comments

Comments
 (0)