From 474e830d081f548777cf5518961fde5dc68a8039 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:48:05 +0100 Subject: [PATCH] fix(core): use connecting handle to update connection (#1996) Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/giant-pants-jam.md | 5 +++++ packages/core/src/composables/useHandle.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/giant-pants-jam.md diff --git a/.changeset/giant-pants-jam.md b/.changeset/giant-pants-jam.md new file mode 100644 index 00000000..b8893849 --- /dev/null +++ b/.changeset/giant-pants-jam.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Use the connecting handle result when updating a connection, so we get an accurate connection position for `toPosition`. diff --git a/packages/core/src/composables/useHandle.ts b/packages/core/src/composables/useHandle.ts index 3ccf7a49..8d8f90c7 100644 --- a/packages/core/src/composables/useHandle.ts +++ b/packages/core/src/composables/useHandle.ts @@ -244,6 +244,7 @@ export function useHandle({ } const connectingHandle = closestHandle ?? result.toHandle + updateConnection( connectingHandle && isValid ? rendererPointToPoint( @@ -254,7 +255,7 @@ export function useHandle({ viewport.value, ) : connectionPosition, - result.toHandle, + connectingHandle, getConnectionStatus(!!connectingHandle, isValid), )