From 6498e0c6f6d3ab293561894809dd6f8062c07920 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 21 Aug 2023 23:44:18 +0200 Subject: [PATCH] button: inconsistent value in `push` mode with `decoupled` enabled when setting value from script --- CHANGELOG.md | 3 ++- src/client/widgets/basics/button.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c845e003..85367b55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ - panel: minor style issue in tab navigation bar - scripting: scripting functions not working inside `browseFile()` callback - scripting: using `external: true` in `set()` should prevent affected widget from sending any message - + - button: inconsistent value in `push` mode with `decoupled` enabled when setting value from script + ## 1.25.2 - bug fixes diff --git a/src/client/widgets/basics/button.js b/src/client/widgets/basics/button.js index 8fd99237..8a4cda5b 100644 --- a/src/client/widgets/basics/button.js +++ b/src/client/widgets/basics/button.js @@ -278,7 +278,7 @@ class Button extends Widget { if (options.fromExternal) { this.state = newstate this.decoupledValue.setValue(newstate, {sync: true}) - } else if (!options.local && this.getProp('mode') === 'push') { + } else if ((!options.local || options.fromScript) && this.getProp('mode') === 'push') { if (newstate === 1 && !this.touchActive) { this.touchActive = 1 setTimeout(()=>{this.touchActive = 0})