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.64k stars 658 forks source link

Support empty slider (no handles / no "start" values) #1237

Closed Ivanca closed 1 year ago

Ivanca commented 1 year ago

Thank you for this library. About the problem: I have a bunch of sliders and sometimes I want to show that some of them have no changing possibilities available, so I need to show them in an empty state, with 0 handles (not just hide them as that may be confusing for my use case), right now it throws an error if you use an empty array for "start" and doesn't render nothing at all

My current workaround has been to copy-paste the HTML generated by this library and manually removing the handles from it to keep a "fake" slider that looks like a normal one (and also keep track of the user interactions who can increase the amount of handles available) but this is not optimal.

leongersen commented 1 year ago

In this case, I'd probably set the slider to some default position, and disable it.

Ivanca commented 1 year ago

For my use case that doesn't make sense, they represent a range of time in a video and empty one symbolizes that there is no chunk created as of now (they can create one with a separate button).

I understand there are a lot of use cases for this plugin and some like mine are too unique to be handled inside the library itself.

github-actions[bot] commented 1 year 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.