diff --git a/ui/common/css/component/_dialog.scss b/ui/common/css/component/_dialog.scss index 6a991e78b4ef..f7c298df6df5 100644 --- a/ui/common/css/component/_dialog.scss +++ b/ui/common/css/component/_dialog.scss @@ -1,3 +1,7 @@ +body:has(dialog.touch-scroll) { + overflow: hidden !important; +} + dialog { @extend %box-radius, %popup-shadow; position: fixed; diff --git a/ui/common/src/dialog.ts b/ui/common/src/dialog.ts index a3726f1f8914..023fe1933a28 100644 --- a/ui/common/src/dialog.ts +++ b/ui/common/src/dialog.ts @@ -69,7 +69,7 @@ export async function alert(msg: string): Promise { await domDialog({ htmlText: escapeHtml(msg), class: 'alert', - show: 'modal', + show: true, }); } @@ -226,7 +226,6 @@ export function snabDialog(o: SnabDialogOpts): VNode { } class DialogWrapper implements Dialog { - private restore?: { focus?: HTMLElement; overflow: string }; private resolve?: (dialog: Dialog) => void; private actionEvents = eventJanitor(); private dialogEvents = eventJanitor(); @@ -339,9 +338,6 @@ class DialogWrapper implements Dialog { private onRemove = () => { this.observer.disconnect(); if (!this.dialog.returnValue) this.dialog.returnValue = 'cancel'; - this.restore?.focus?.focus(); // one modal at a time please - if (this.restore?.overflow !== undefined) document.body.style.overflow = this.restore.overflow; - this.restore = undefined; this.resolve?.(this); this.o.onClose?.(this); this.dialog.remove();