matrix: dynamic children update fix

This commit is contained in:
jean-emmanuel 2018-10-17 13:57:07 +02:00
parent 44c9661b02
commit a2572821ce

View file

@ -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
}