Et2InputWidget: Give clones of object values so receiver cannot use the reference

Fixes failing change detection in EgwApp.update_state, since the value was the same object
This commit is contained in:
nathan 2023-04-25 09:08:35 -06:00
parent f1a5b24249
commit 759eb22505

View File

@ -367,7 +367,10 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
getValue()
{
return this.readonly || this.disabled ? null : this.value;
return this.readonly || this.disabled ? null : (
// Give a clone of objects or receiver might use the reference
typeof this.value == "object" ? (typeof this.value.length == "undefined" ? {...this.value} : [...this.value]) : this.value
);
}
/**