Et2Select: Better handling for when select_options & value get set one after the other

This caused selectbox to look empty, even though it had a value since the new menu-items hadn't been created when value was set
This commit is contained in:
nathan 2022-08-03 16:04:08 -06:00
parent ed92763176
commit f7cf372f09

View File

@ -304,9 +304,11 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
if(changedProperties.has('select_options') || changedProperties.has("value") || changedProperties.has('emptyLabel'))
{
this.fix_bad_value();
}
if(changedProperties.has("select_options") && changedProperties.has("value"))
{
// Re-set value, the option for it may have just shown up
this.value = this.value || "";
this.updateComplete.then(() => this.syncItemsFromValue())
}
}