From 79ce7e6bac7c8d5cf4d4e8e1657a7a985fc1c61a Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 9 Dec 2020 17:14:19 +0100 Subject: [PATCH] clone: make `props` property dynamic (avoid full widget rebuild when possible) --- CHANGELOG.md | 3 +++ src/client/widgets/containers/clone.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86bde942..dbff62a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ - canvas-based widgets not drawn when placed in a modal while having a conditional visibility set - text: missing `decimals` property +- widgets + - clone: make `props` property dynamic (avoid full widget rebuild when possible) + ## 1.7.7 diff --git a/src/client/widgets/containers/clone.js b/src/client/widgets/containers/clone.js index 7686bdc9..58ca1c69 100644 --- a/src/client/widgets/containers/clone.js +++ b/src/client/widgets/containers/clone.js @@ -293,6 +293,9 @@ class Clone extends Container() { this.bindTarget(this.getCloneTarget()) if (this.cloneTarget) this.createClone() return + case 'props': + if (this.children[0]) this.updateClone() + return case 'colorText': case 'colorWidget': case 'colorFill': @@ -322,7 +325,8 @@ class Clone extends Container() { } Clone.dynamicProps = Clone.prototype.constructor.dynamicProps.concat( - 'widgetId' + 'widgetId', + 'props' ) module.exports = Clone