fix: popup glitches caused by long calculations (#4511)

Signed-off-by: Eduard Aksamitov <e@euaaaio.ru>
This commit is contained in:
Eduard Aksamitov 2024-02-05 12:05:20 +03:00 committed by GitHub
parent d759608a6c
commit 889f83fc52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,8 +112,8 @@
let oldModalHTML: HTMLElement | undefined = undefined let oldModalHTML: HTMLElement | undefined = undefined
$: if (modalHTML !== undefined && oldModalHTML !== modalHTML) { $: if (modalHTML !== undefined && oldModalHTML !== modalHTML) {
clientWidth = -1 clientWidth = modalHTML.clientWidth
clientHeight = -1 clientHeight = modalHTML.clientHeight
oldModalHTML = modalHTML oldModalHTML = modalHTML
fitPopup(modalHTML, element, contentPanel) fitPopup(modalHTML, element, contentPanel)
showing = true showing = true
@ -127,7 +127,9 @@
} }
export function fitPopupInstance (): void { export function fitPopupInstance (): void {
if (modalHTML) fitPopup(modalHTML, element, contentPanel) if (modalHTML) {
fitPopup(modalHTML, element, contentPanel)
}
} }
$: if ($deviceInfo.docWidth <= 900 && !docSize) docSize = true $: if ($deviceInfo.docWidth <= 900 && !docSize) docSize = true