Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change the value without triggering the output event. #218

Open
arthurc2000 opened this issue Feb 8, 2022 · 1 comment

Comments

@arthurc2000
Copy link

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.

@marcelblum
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants