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

Accessing old value in update event #1228

Open
xeruf opened this issue Sep 29, 2022 · 0 comments
Open

Accessing old value in update event #1228

xeruf opened this issue Sep 29, 2022 · 0 comments
Labels
Documentation Issues that require documentation updates

Comments

@xeruf
Copy link

xeruf commented Sep 29, 2022

I would like to check on update whether the value increased or decreased. There does not seem a way to do this without tracking state separately, as this.get() already returns the new value.

Furthermore, it would be good to mention in https://refreshless.com/nouislider/events-callbacks/#section-binding that this won't be set if you use a lambda:

        slider.noUiSlider.on('update', (values, handle) => {
          console.log(this)
        })

While this works:

        slider.noUiSlider.on('update', function(values, handle) {
          console.log(this)
        })
@xeruf xeruf changed the title Accessing old value in even Accessing old value in update event Sep 29, 2022
@leongersen leongersen added the Documentation Issues that require documentation updates label Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues that require documentation updates
Projects
None yet
Development

No branches or pull requests

2 participants