clone: prevent cloned widgets from recreating themselves from prop inheritance changes

-> the clone widget was already watching for its target widget-created events and updating accordingly,
   thus causing concurrent attempts to update its children, errors and memory leaks
This commit is contained in:
jean-emmanuel 2018-01-24 12:34:48 +01:00
parent 50e934a697
commit aa0590b150

View file

@ -55,6 +55,12 @@ module.exports = class Clone extends _widgets_base {
}
})
this.on('widget-created', (e)=>{
if (e.widget == this) return
widgetManager.off(`change.${e.widget.hash}`)
widgetManager.off(`widget-creates.${e.widget.hash}`)
})
}
createClone(widget) {