diff --git a/frontend/src/ts/modals/register-captcha.ts b/frontend/src/ts/modals/register-captcha.ts index 8e3e610cd8a7..7be9e58ba6ee 100644 --- a/frontend/src/ts/modals/register-captcha.ts +++ b/frontend/src/ts/modals/register-captcha.ts @@ -9,6 +9,7 @@ export let promise = new Promise((resolve) => { export function show(): void { void modal.show({ + mode: "dialog", beforeAnimation: async (modal) => { promise = new Promise((resolve) => { resolvePromise = resolve; diff --git a/frontend/src/ts/utils/animated-modal.ts b/frontend/src/ts/utils/animated-modal.ts index a30c1ae4fee8..099af995670c 100644 --- a/frontend/src/ts/utils/animated-modal.ts +++ b/frontend/src/ts/utils/animated-modal.ts @@ -27,6 +27,7 @@ type ShowHideOptions = { }; export type ShowOptions = ShowHideOptions & { + mode?: "modal" | "dialog"; focusFirstInput?: true | "focusAndSelect"; modalChain?: AnimatedModal; }; @@ -199,7 +200,11 @@ export default class AnimatedModal { } this.open = true; - this.wrapperEl.showModal(); + if (options?.mode === "dialog") { + this.wrapperEl.show(); + } else if (options?.mode === "modal" || options?.mode === undefined) { + this.wrapperEl.showModal(); + } //wait until the next event loop to allow the dialog to start animating setTimeout(async () => {