From 889f83fc525f3d660af708681072e9758a84aae6 Mon Sep 17 00:00:00 2001 From: Eduard Aksamitov Date: Mon, 5 Feb 2024 12:05:20 +0300 Subject: [PATCH] fix: popup glitches caused by long calculations (#4511) Signed-off-by: Eduard Aksamitov --- packages/ui/src/components/PopupInstance.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/PopupInstance.svelte b/packages/ui/src/components/PopupInstance.svelte index 5f48f610a5..524dfc562b 100644 --- a/packages/ui/src/components/PopupInstance.svelte +++ b/packages/ui/src/components/PopupInstance.svelte @@ -112,8 +112,8 @@ let oldModalHTML: HTMLElement | undefined = undefined $: if (modalHTML !== undefined && oldModalHTML !== modalHTML) { - clientWidth = -1 - clientHeight = -1 + clientWidth = modalHTML.clientWidth + clientHeight = modalHTML.clientHeight oldModalHTML = modalHTML fitPopup(modalHTML, element, contentPanel) showing = true @@ -127,7 +127,9 @@ } export function fitPopupInstance (): void { - if (modalHTML) fitPopup(modalHTML, element, contentPanel) + if (modalHTML) { + fitPopup(modalHTML, element, contentPanel) + } } $: if ($deviceInfo.docWidth <= 900 && !docSize) docSize = true