button: inconsistent value in push mode with decoupled enabled when setting value from script

This commit is contained in:
jean-emmanuel 2023-08-21 23:44:18 +02:00
parent c766370db7
commit 6498e0c6f6
2 changed files with 3 additions and 2 deletions

View file

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

View file

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