From 3977875d0b495de8a52fd240d96658aece8d353c Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:56:37 +0100 Subject: [PATCH] refactor(core): trigger fitViewOnInit together with paneReady --- packages/core/src/store/actions.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index ab6f0893..6fc9690a 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -971,6 +971,13 @@ export function useActions( .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,