fix(core): avoid removing handle bounds on handle unmount (#1781)

* fix(core): avoid removing handle bounds on handle unmount

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

* chore(changeset): add

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>

---------

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2025-03-04 11:01:37 +01:00
parent 49b2780740
commit dd9c92ff81
2 changed files with 6 additions and 9 deletions

View File

@@ -0,0 +1,5 @@
---
"@vue-flow/core": patch
---
Prevent removal of handle bounds when `<Handle>` is unmounted.

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, ref, toRef } from 'vue'
import { computed, onMounted, ref, toRef } from 'vue'
import type { HandleProps } from '../../types'
import { Position } from '../../types'
import { useHandle, useNode, useVueFlow } from '../../composables'
@@ -136,14 +136,6 @@ onMounted(() => {
node.handleBounds[type.value] = [...(node.handleBounds[type.value] ?? []), nextBounds]
})
onUnmounted(() => {
// clean up node internals
const handleBounds = node.handleBounds[type.value]
if (handleBounds) {
node.handleBounds[type.value] = handleBounds.filter((b) => b.id !== handleId)
}
})
function onPointerDown(event: MouseEvent | TouchEvent) {
const isMouseTriggered = isMouseEvent(event)