fix: sign up captcha challenge appearing under the modal, making it impossible to sign up

This commit is contained in:
Miodec 2024-03-14 20:37:45 +01:00
parent c3671fbc75
commit 3a012bd3b9
2 changed files with 7 additions and 1 deletions

View file

@ -9,6 +9,7 @@ export let promise = new Promise<string | undefined>((resolve) => {
export function show(): void {
void modal.show({
mode: "dialog",
beforeAnimation: async (modal) => {
promise = new Promise((resolve) => {
resolvePromise = resolve;

View file

@ -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 () => {