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 { resetForms(): void {
this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => { 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 { resetForms(): void {
this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => { this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => {
form?.resetForm(); if ("resetForm" in form) {
form?.resetForm();
}
}); });
} }