From 1bfc558f83deef094b4d1bd2e986f4693c4e55e8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 11 Jan 2025 14:20:17 +0100 Subject: [PATCH] editor: force property update to prevent advanced syntax change from being unnoticed by clone widgets For instance, a VAR{} may be renamed without its return value to change immediately --- CHANGELOG.md | 1 + src/client/widgets/common/widget.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5110013c..f6dc35a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - multixy: `default` not applied when points are named - clone: avoid some unnecessary property checks + - clone: prevent missing editions in target properties (e.g. VAR{} renamed with the same return value) - client - show 3-dots menu in read-only mode with access to allowed items (e.g fullscreen) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 49e67e43..06dee133 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -915,7 +915,9 @@ class Widget extends EventEmitter { let propValue = this.resolveProp(propName, undefined, false), oldPropValue = this.getProp(propName) - if (!deepEqual(oldPropValue, propValue)) { + if (!deepEqual(oldPropValue, propValue) || (options && options.fromEditor)) { + // forced if initiated by the editor to make sure advanced syntax changes don't go unnoticed by clone + // (a VAR{} may be renamed without its return value to change immediately) if (!this.isDynamicProp(propName)) {