diff --git a/src/client/widgets/common/widget.mjs b/src/client/widgets/common/widget.mjs index c579ad94..a5626a35 100644 --- a/src/client/widgets/common/widget.mjs +++ b/src/client/widgets/common/widget.mjs @@ -392,6 +392,24 @@ class Widget extends EventEmitter { } + areEquivalentValueProps(a, b) { + /* See commit c1720b4a and https://openstagecontrol.discourse.group/t/widget-update-when-setting-value-via-edit/4186/7 + * for the root of this... + */ + + var currentValue = deepCopy(this.value) + var va, vb + + this.setValue(a, {coerceTest: true}) + va = deepCopy(this.value) + this.setValue(b, {coerceTest: true}) + vb = deepCopy(this.value) + + this.setValue(currentValue) + + return deepEqual(va, vb) + } + checkLinkedProps(propNames) { // Dynamic props cache check @@ -1000,9 +1018,8 @@ class Widget extends EventEmitter { if ( !deepEqual(oldPropValue, propValue) || - (options && options.fromEditor && propName == 'value' && !deepEqual(oldPropValue, this.value)) + (options && options.fromEditor && propName == 'value' && !this.areEquivalentValueProps(propValue, oldPropValue)) ) { - if (!this.isDynamicProp(propName)) { if (this.constructor._defaults[propName] === undefined) {