fix(core): update node dimensions on next tick
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { computed, defineComponent, h, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
|
import { computed, defineComponent, h, nextTick, onBeforeUnmount, onMounted, provide, ref, watch } from 'vue'
|
||||||
import { until, useVModel } from '@vueuse/core'
|
import { until, useVModel } from '@vueuse/core'
|
||||||
import {
|
import {
|
||||||
ARIA_NODE_DESC_KEY,
|
ARIA_NODE_DESC_KEY,
|
||||||
@@ -121,13 +121,11 @@ const NodeWrapper = defineComponent({
|
|||||||
props.resizeObserver.unobserve(nodeElement.value as HTMLDivElement)
|
props.resizeObserver.unobserve(nodeElement.value as HTMLDivElement)
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
watch([() => node.value.type, () => node.value.sourcePosition, () => node.value.targetPosition], () => {
|
||||||
[() => node.value.type, () => node.value.sourcePosition, () => node.value.targetPosition],
|
nextTick(() => {
|
||||||
() => {
|
|
||||||
updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value as HTMLDivElement, forceUpdate: true }])
|
updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value as HTMLDivElement, forceUpdate: true }])
|
||||||
},
|
})
|
||||||
{ flush: 'pre' },
|
})
|
||||||
)
|
|
||||||
|
|
||||||
/** this watcher only updates XYZPosition (when dragging a parent etc) */
|
/** this watcher only updates XYZPosition (when dragging a parent etc) */
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
Reference in New Issue
Block a user