Et2Select: Fix selects with options from file were not showing their initial set value

This commit is contained in:
nathan 2023-11-21 12:00:08 -07:00
parent 6224c2c0c5
commit 688de6d52c

View File

@ -508,7 +508,17 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
}
if(changedProperties.has("select_options") || changedProperties.has("value") || changedProperties.has("emptyLabel"))
{
this.updateComplete.then(() => this.fix_bad_value());
this.updateComplete.then(() =>
{
this.fix_bad_value();
// Force select to stay in sync, avoids value not shown when select options arrive late
if(this.select && this.value !== null && typeof this.value !== "undefined")
{
this.select.value = this.value;
}
});
}
if(changedProperties.has("select_options") && changedProperties.has("value"))
{