From cd4e3b35bbddba7e3fbb819dffb1ae99212538d6 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 8 Nov 2026 01:24:26 +0100 Subject: [PATCH] editor: fix call stack overflow caused by commit c1720b4a --- src/client/widgets/common/widget.mjs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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) {