Skip to content

Commit dd9c92f

Browse files
committed
fix(core): avoid removing handle bounds on handle unmount (#1781)
* fix(core): avoid removing handle bounds on handle unmount Signed-off-by: braks <[email protected]> * chore(changeset): add Signed-off-by: braks <[email protected]> --------- Signed-off-by: braks <[email protected]>
1 parent 49b2780 commit dd9c92f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.changeset/plenty-rocks-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+
Prevent removal of handle bounds when `<Handle>` is unmounted.

packages/core/src/components/Handle/Handle.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts" setup>
2-
import { computed, onMounted, onUnmounted, ref, toRef } from 'vue'
2+
import { computed, onMounted, ref, toRef } from 'vue'
33
import type { HandleProps } from '../../types'
44
import { Position } from '../../types'
55
import { useHandle, useNode, useVueFlow } from '../../composables'
@@ -136,14 +136,6 @@ onMounted(() => {
136136
node.handleBounds[type.value] = [...(node.handleBounds[type.value] ?? []), nextBounds]
137137
})
138138
139-
onUnmounted(() => {
140-
// clean up node internals
141-
const handleBounds = node.handleBounds[type.value]
142-
if (handleBounds) {
143-
node.handleBounds[type.value] = handleBounds.filter((b) => b.id !== handleId)
144-
}
145-
})
146-
147139
function onPointerDown(event: MouseEvent | TouchEvent) {
148140
const isMouseTriggered = isMouseEvent(event)
149141

0 commit comments

Comments
 (0)