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

Feature request: allow for connectSlider handles swap (drag handles across each-other and connect between or outside) #1262

Closed demonoff closed 4 weeks ago

demonoff commented 6 months ago

Hi there, thank you for a very nice device. Is there an option for the first handle to go beyond the second handle?

I am doing a small student research project in which I ask participants when they go to bed and when they wake up. For that a slider with 24 hours is perfect. Although, some people go to bed at 01:00 at night and wake up at 09:00 in the morning (this situation is well handled in current settings and the sleep time can be connected). However, for people who go to bed at 22:00 in the evening and wake up at 06:00 in the morning the connection should be inverted (and people should be able to drag one handle across the other handle to be able to select this option). Is that possible?

So in brief, if on the 24 h scale:

leongersen commented 6 months ago

It sounds like you are looking for "unconstrained" behaviour.

demonoff commented 6 months ago

Wow! Thanks for a swift response. The "unconstrained" behaviour looks a lot like it! But is there an option to switch the connection:

leongersen commented 4 weeks ago

This feature was contributed by @5andr0 and is in noUiSlider 15.8.0. Thanks!