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 34e71f2ed2
commit 5b9cf0ae0b

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
);
}
/**