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

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