Fix filtered out invalid values were still left in value

This commit is contained in:
nathan 2023-05-09 14:28:02 -06:00
parent 3e1b1e56dc
commit 820bd35689

View File

@ -448,7 +448,12 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
); );
// Check for value using missing options (deleted or otherwise not allowed) // 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 // Multiple is allowed to be empty, and if we don't have an emptyLabel nothing to do
if(this.multiple || !this.emptyLabel) if(this.multiple || !this.emptyLabel)
@ -773,8 +778,6 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
{ {
super.et2HandleBlur(event); super.et2HandleBlur(event);
} }
console.log("Blur event");
this.dropdown?.hide(); this.dropdown?.hide();
} }