Skip to content

Accessing old value in update event #1228

@xeruf

Description

@xeruf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues that require documentation updates

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions