From ac408f4eef808425edfd5edd2ff7dfc9c8b482c5 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 1 Mar 2022 16:09:27 +0200 Subject: [PATCH] Change handler setting modelValue for validation setting it in getValue() alone does not remove validation message direct after entering a date --- api/js/etemplate/Et2Date/Et2Date.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Date/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts index 05a76eb1d4..3e1e3cbb6c 100644 --- a/api/js/etemplate/Et2Date/Et2Date.ts +++ b/api/js/etemplate/Et2Date/Et2Date.ts @@ -395,6 +395,21 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl return value; } + /** + * Change handler setting modelValue for validation + * + * @param _ev + * @returns + */ + _onChange(_ev : Event) : boolean + { + const ret = super._onChange(_ev); + + this.modelValue = this.getValue(); + + return ret; + } + /** * Set the minimum allowed date * @param {string | Date} min @@ -445,4 +460,4 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl } // @ts-ignore TypeScript is not recognizing that Et2Date is a LitElement -customElements.define("et2-date", Et2Date); +customElements.define("et2-date", Et2Date); \ No newline at end of file