From c2aad1e43bd5c3bc661b2a4f907591468ab49006 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 12 Aug 2025 17:05:26 +0200 Subject: [PATCH] fix(core): fetch correct source and target nodes for isValidConnection (#1922) * fix(core): fetch correct source and target nodes for isValidConnection Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> * chore(changeset): add --------- Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/stale-phones-cross.md | 5 +++++ packages/core/src/utils/handle.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/stale-phones-cross.md diff --git a/.changeset/stale-phones-cross.md b/.changeset/stale-phones-cross.md new file mode 100644 index 00000000..d60674c2 --- /dev/null +++ b/.changeset/stale-phones-cross.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Fetch the correct source and target nodes for isValidConnection. diff --git a/packages/core/src/utils/handle.ts b/packages/core/src/utils/handle.ts index 2fe2d065..f52bfb9a 100644 --- a/packages/core/src/utils/handle.ts +++ b/packages/core/src/utils/handle.ts @@ -191,8 +191,8 @@ export function isValidHandle( isValidConnection(connection, { nodes, edges, - sourceNode: findNode(fromNodeId)!, - targetNode: findNode(handleNodeId)!, + sourceNode: findNode(connection.source)!, + targetNode: findNode(connection.target)!, }) result.toHandle = handle