Skip to content

Commit 4bbc14b

Browse files
committed
fix(core): update node dimensions on next tick
1 parent 4d8cd3c commit 4bbc14b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/core/src/components/Nodes/NodeWrapper.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { computed, defineComponent, h, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
1+
import { computed, defineComponent, h, nextTick, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
22
import { until, useVModel } from '@vueuse/core'
33
import {
44
ARIA_NODE_DESC_KEY,
@@ -121,13 +121,11 @@ const NodeWrapper = defineComponent({
121121
props.resizeObserver.unobserve(nodeElement.value as HTMLDivElement)
122122
})
123123

124-
watch(
125-
[() => node.value.type, () => node.value.sourcePosition, () => node.value.targetPosition],
126-
() => {
124+
watch([() => node.value.type, () => node.value.sourcePosition, () => node.value.targetPosition], () => {
125+
nextTick(() => {
127126
updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value as HTMLDivElement, forceUpdate: true }])
128-
},
129-
{ flush: 'pre' },
130-
)
127+
})
128+
})
131129

132130
/** this watcher only updates XYZPosition (when dragging a parent etc) */
133131
watch(

0 commit comments

Comments
 (0)