leongersen / noUiSlider

noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies.
https://refreshless.com/nouislider/
MIT License
5.69k stars 657 forks source link

Accept user input while animating #1115

Closed GitFr33 closed 3 years ago

GitFr33 commented 3 years ago

Is there a way to make noUiSlider respond to user input while it is being set by javascript? It seems like the default behaviour is to disable user input when noUiSlider.set() is called until animation is finished. If not, is there a way to speed up the animation to reduce the amount of time that the slider is busy animating.

I am using noUiSlider as a seekbar for an html audio player. The noUiSlider is set every second to reflect progress as a song plays. noUiSlider works well for this but my problem is that much of the time it is busy animating, so when the user tries to use the scrubber to rewind of fast-forward if often doesn't respond.

leongersen commented 3 years ago

I think for your use the best solution would to to disable the animation. You can set animate to false (which will allow user interaction), and optionally remove the CSS transition. Here's the documentation on the animate option.

GitFr33 commented 3 years ago

Thank you @leongersen!

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.