button: decoupled push mode returning wrong value when activated from a widget script

This commit is contained in:
jean-emmanuel 2022-10-23 10:29:29 +02:00
parent 6cbddbd2b6
commit bf97ebceb5
2 changed files with 8 additions and 0 deletions

View file

@ -4,6 +4,7 @@
- bug fixes
- button: regression in push mode (`on` value not passed to `onValue` script when triggered from another widget)
- button: decoupled push mode returning wrong value when activated from a widget script
## 1.18.2

View file

@ -279,6 +279,13 @@ class Button extends Widget {
if (options.fromExternal) {
this.state = newstate
this.decoupledValue.setValue(newstate, {sync: true})
} else if (!options.local && this.getProp('mode') === 'push') {
if (newstate === 1 && !this.touchActive) {
this.touchActive = 1
setTimeout(()=>{this.touchActive = 0})
} else {
this.touchActive = 0
}
}
} else {