From b509b11bfc5e6aefc3f92f16763142e4766f6e61 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:33:27 +0100 Subject: [PATCH] fix(core): wait until fitting view on init Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- packages/core/src/store/actions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/src/store/actions.ts b/packages/core/src/store/actions.ts index 475d664d..7c043f23 100644 --- a/packages/core/src/store/actions.ts +++ b/packages/core/src/store/actions.ts @@ -147,7 +147,12 @@ export function useActions(state: State, getters: ComputedGetters): Actions { }, []) if (state.fitViewOnInit && !fitViewOnInitDone) { - viewportHelper.fitView() + until(() => viewportHelper.initialized) + .toBe(true) + .then(() => { + viewportHelper.fitView() + }) + fitViewOnInitDone = true }