diff --git a/.changeset/smart-lies-impress.md b/.changeset/smart-lies-impress.md new file mode 100644 index 00000000..89086bdd --- /dev/null +++ b/.changeset/smart-lies-impress.md @@ -0,0 +1,5 @@ +--- +"@vue-flow/core": patch +--- + +Use all handle bounds when using loose connection mode during edge update diff --git a/packages/core/src/components/ConnectionLine/index.ts b/packages/core/src/components/ConnectionLine/index.ts index 025ec562..e9cc7838 100644 --- a/packages/core/src/components/ConnectionLine/index.ts +++ b/packages/core/src/components/ConnectionLine/index.ts @@ -62,10 +62,11 @@ const ConnectionLine = defineComponent({ const handleType = connectionStartHandle.value.type const fromHandleBounds = fromNode.value.handleBounds - let handleBounds = fromHandleBounds?.[handleType] + let handleBounds = fromHandleBounds?.[handleType] || [] if (connectionMode.value === ConnectionMode.Loose) { - handleBounds = handleBounds || fromHandleBounds?.[handleType === 'source' ? 'target' : 'source'] + const oppositeBounds = fromHandleBounds?.[handleType === 'source' ? 'target' : 'source'] || [] + handleBounds = [...handleBounds, ...oppositeBounds] || oppositeBounds } if (!handleBounds) {