From 52a3665770a9fbc823e3638859f067e45d1fd63e Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 17 Oct 2018 13:57:07 +0200 Subject: [PATCH] matrix: dynamic children update fix --- src/browser/js/app/widgets/matrices/matrix.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/browser/js/app/widgets/matrices/matrix.js b/src/browser/js/app/widgets/matrices/matrix.js index 948d136c..6da98710 100644 --- a/src/browser/js/app/widgets/matrices/matrix.js +++ b/src/browser/js/app/widgets/matrices/matrix.js @@ -81,26 +81,20 @@ class Matrix extends _matrix_base { case 'props': - var children = [...this.children] - for (let i = children.length - 1; i >= 0; i--) { + for (let i = this.children.length - 1; i >= 0; i--) { - let widget = children[i], - data = this.resolveProp('props', undefined, false, false, false, {'$':i}) + let data = this.resolveProp('props', undefined, false, false, false, {'$':i}) if (typeof data === 'object' && data !== null) { - Object.assign(widget.props, data) + Object.assign(this.children[i].props, data) } - widget.updateProps(Object.keys(data), this) + this.children[i].updateProps(Object.keys(data), this) + // this.children[i] might have been recreated + this.children[i].container.classList.add('not-editable') } - - for (let i = this.children - 1; i >= 0; i--) { - let widget = children[i] - widget.container.classList.add('not-editable') - } - return }