Skip to content

Commit a6ec480

Browse files
authored
fix(core): use all handle bounds in loose connection mode (#1665)
* fix(core): use all handle bounds with loose mode when updating edges Signed-off-by: braks <[email protected]> * chore(changeset): add Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]>
1 parent a41bd7b commit a6ec480

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/smart-lies-impress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vue-flow/core": patch
3+
---
4+
5+
Use all handle bounds when using loose connection mode during edge update

packages/core/src/components/ConnectionLine/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ const ConnectionLine = defineComponent({
6262
const handleType = connectionStartHandle.value.type
6363

6464
const fromHandleBounds = fromNode.value.handleBounds
65-
let handleBounds = fromHandleBounds?.[handleType]
65+
let handleBounds = fromHandleBounds?.[handleType] || []
6666

6767
if (connectionMode.value === ConnectionMode.Loose) {
68-
handleBounds = handleBounds || fromHandleBounds?.[handleType === 'source' ? 'target' : 'source']
68+
const oppositeBounds = fromHandleBounds?.[handleType === 'source' ? 'target' : 'source'] || []
69+
handleBounds = [...handleBounds, ...oppositeBounds] || oppositeBounds
6970
}
7071

7172
if (!handleBounds) {

0 commit comments

Comments
 (0)