ui
ui copied to clipboard
Is it possible to change the value without triggering the output event.
trafficstars
I attempted to recover the UI display without to trigger the output event. Is it possible to do that without working around it ?
Thanks Arthur
e.g. for Number
https://nexus-js.github.io/ui/api/#Number
value number The interface's current value. If set manually, will update the interface and trigger the output event.
For most Nexus components the change event handler allows you to check this.clicked to determine whether the value change happened from a direct user interaction or not. You can use that to have different code run in either scenario. For example
number.on('change', function(value) {
if (this.clicked) {
// do stuff to handle a value change actually made by user
} else {
// do nothing, or do stuff that should only happen when the value is changed internally/manually
}
})