Et2Select: Fix change event got fired too early

Don't need to block the event if we didn't actually change the value.  This fixes changing to common preferences
This commit is contained in:
nathan 2022-11-09 15:34:28 -07:00
parent cbccbba108
commit 47a48b386f

View File

@ -284,7 +284,7 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
{ {
let oldValue = this.value; let oldValue = this.value;
this.value = this.emptyLabel ? "" : "" + this.select_options[0]?.value; this.value = this.emptyLabel ? "" : "" + this.select_options[0]?.value;
this._block_change_event = true; this._block_change_event = (oldValue != this.value);
// ""+ to cast value of 0 to "0", to not replace with "" // ""+ to cast value of 0 to "0", to not replace with ""
this.requestUpdate("value", oldValue); this.requestUpdate("value", oldValue);
} }