From 820bd356899d835eb100f589282bbdb0ef2977d9 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 9 May 2023 14:28:02 -0600 Subject: [PATCH] Fix filtered out invalid values were still left in value --- api/js/etemplate/Et2Select/Et2Select.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/Et2Select/Et2Select.ts b/api/js/etemplate/Et2Select/Et2Select.ts index eaa7021f82..46bc3cc5fc 100644 --- a/api/js/etemplate/Et2Select/Et2Select.ts +++ b/api/js/etemplate/Et2Select/Et2Select.ts @@ -448,7 +448,12 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) ); // Check for value using missing options (deleted or otherwise not allowed) - valueArray = this.filterOutMissingOptions(valueArray); + let filtered = this.filterOutMissingOptions(valueArray); + if(filtered.length != valueArray.length) + { + this.value = filtered; + return; + } // Multiple is allowed to be empty, and if we don't have an emptyLabel nothing to do if(this.multiple || !this.emptyLabel) @@ -773,8 +778,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect) { super.et2HandleBlur(event); } - console.log("Blur event"); - this.dropdown?.hide(); }