From 424f6cf63c5c9a295ca9a3a901a96838846d0701 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:31:33 +0100 Subject: [PATCH] fix(core): correct connection keys (#1749) * fix(core): correct connection keys Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/strong-buttons-wink.md | 5 +++++ packages/core/src/utils/store.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/strong-buttons-wink.md diff --git a/.changeset/strong-buttons-wink.md b/.changeset/strong-buttons-wink.md new file mode 100644 index 000000000..c01fb390a --- /dev/null +++ b/.changeset/strong-buttons-wink.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Correct connection keys. diff --git a/packages/core/src/utils/store.ts b/packages/core/src/utils/store.ts index f6e86e317..eb8f28312 100644 --- a/packages/core/src/utils/store.ts +++ b/packages/core/src/utils/store.ts @@ -171,8 +171,8 @@ export function updateConnectionLookup(connectionLookup: ConnectionLookup, edgeL const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle } - const sourceKey = `${sourceNode}-${sourceHandle}` - const targetKey = `${targetNode}-${targetHandle}` + const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}` + const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}` addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle) addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle)