editor: fix call stack overflow caused by commit c1720b4a
This commit is contained in:
parent
2790b7d86e
commit
cd4e3b35bb
1 changed files with 19 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue