web/admin: handle elements in slot=form not being forms

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-21 22:48:47 +02:00
parent 9b5e3921cb
commit 04e52d8ba6
2 changed files with 6 additions and 2 deletions

View File

@ -54,7 +54,9 @@ export class ModalButton extends LitElement {
resetForms(): void {
this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => {
form?.resetForm();
if ("resetForm" in form) {
form?.resetForm();
}
});
}

View File

@ -34,7 +34,9 @@ export abstract class TableModal<T> extends Table<T> {
resetForms(): void {
this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => {
form?.resetForm();
if ("resetForm" in form) {
form?.resetForm();
}
});
}