web: fix submit in Modal reloading page in firefox

This commit is contained in:
Jens Langhammer 2021-03-03 23:01:47 +01:00
parent 32655567da
commit bb63d08682
1 changed files with 4 additions and 1 deletions

View File

@ -61,7 +61,10 @@ export class SpinnerButton extends LitElement {
if (this.form) {
// Since the form= attribute is only used within a modal button,
// we can assume the form is always two levels up
this.parentElement?.parentElement?.querySelector < HTMLFormElement>(`#${this.form}`)?.dispatchEvent(new Event("submit"));
this.parentElement?.parentElement?.querySelector<HTMLFormElement>(`#${this.form}`)?.dispatchEvent(new Event("submit", {
bubbles: true,
cancelable: true,
}));
}
this.setLoading();
}