refactor(core): move fitViewOnInit to node dimensions update

This commit is contained in:
braks
2024-02-05 07:51:12 +01:00
committed by Braks
parent 97f4a17f83
commit f09b7d934b
2 changed files with 10 additions and 21 deletions
+9 -18
View File
@@ -947,24 +947,15 @@ export function useActions(
until(() => viewportHelper.value.initialized)
.toBe(true)
.then(() => {
setTimeout(() => {
// todo: move this to when *nodes* are initialized instead of viewport
if (!state.fitViewOnInitDone && state.fitViewOnInit) {
viewportHelper.value.fitView()
}
state.fitViewOnInitDone = true
state.hooks.paneReady.trigger({
id,
emits,
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : 'UNKNOWN',
...hooksOn,
...state,
...getters,
...actions,
})
}, 1)
state.hooks.paneReady.trigger({
id,
emits,
vueFlowVersion: typeof __VUE_FLOW_VERSION__ !== 'undefined' ? __VUE_FLOW_VERSION__ : 'UNKNOWN',
...hooksOn,
...state,
...getters,
...actions,
})
})
return actions