File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/core/src/components/Handle Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
2
import { toRef , until } from ' @vueuse/core'
3
- import { computed , ref } from ' vue'
3
+ import { computed , onBeforeUnmount , ref } from ' vue'
4
4
import type { HandleProps } from ' ../../types/handle'
5
5
import { Position } from ' ../../types'
6
6
import { useHandle , useNode , useVueFlow } from ' ../../composables'
@@ -131,6 +131,14 @@ until(() => node.initialized)
131
131
node .handleBounds [type .value ] = [... (node .handleBounds [type .value ] ?? []), nextBounds ]
132
132
})
133
133
134
+ onBeforeUnmount (() => {
135
+ // clean up node internals
136
+ const handleBounds = node .handleBounds [type .value ]
137
+ if (handleBounds ) {
138
+ node .handleBounds [type .value ] = handleBounds .filter ((b ) => b .id !== handleId .value )
139
+ }
140
+ })
141
+
134
142
function onPointerDown(event : MouseEvent | TouchEvent ) {
135
143
const isMouseTriggered = isMouseEvent (event )
136
144
You can’t perform that action at this time.
0 commit comments