web: fix t.reset is not a function
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		| @ -55,7 +55,7 @@ export class ModalButton extends LitElement { | |||||||
|  |  | ||||||
|     resetForms(): void { |     resetForms(): void { | ||||||
|         this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => { |         this.querySelectorAll<HTMLFormElement>("[slot=form]").forEach(form => { | ||||||
|             form.reset(); |             form?.reset(); | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -76,10 +76,7 @@ export class Form<T> extends LitElement { | |||||||
|      */ |      */ | ||||||
|     reset(): void { |     reset(): void { | ||||||
|         const ironForm = this.shadowRoot?.querySelector("iron-form"); |         const ironForm = this.shadowRoot?.querySelector("iron-form"); | ||||||
|         if (!ironForm) { |         ironForm?.reset(); | ||||||
|             return; |  | ||||||
|         } |  | ||||||
|         ironForm.reset(); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -23,7 +23,7 @@ export class ModalForm extends ModalButton { | |||||||
|         return formPromise.then(() => { |         return formPromise.then(() => { | ||||||
|             if (this.closeAfterSuccessfulSubmit) { |             if (this.closeAfterSuccessfulSubmit) { | ||||||
|                 this.open = false; |                 this.open = false; | ||||||
|                 form.reset(); |                 form?.reset(); | ||||||
|             } |             } | ||||||
|             this.dispatchEvent( |             this.dispatchEvent( | ||||||
|                 new CustomEvent(EVENT_REFRESH, { |                 new CustomEvent(EVENT_REFRESH, { | ||||||
|  | |||||||
| @ -34,7 +34,7 @@ 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.reset(); |             form?.reset(); | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer