tajo / react-range

🎚️Range input with a slider. Accessible. Bring your own styles and markup.
https://react-range.pages.dev
MIT License
847 stars 97 forks source link

Query: No overlap but allow neighbouring handles to be pushed around #191

Open solace opened 7 months ago

solace commented 7 months ago

Hi,

I'm using react-range for an audio range with one handle for the start, one for the end, and one for the playhead. Start and end cannot overlap, and playhead must be between start and end. But I would like start and end to be able to push the playhead around. eg. If start is dragged past where playhead is, playhead moves with it so it also increases, but never falls behind start and neither can go past end.

Is this something I could achieve with the current functionality?

The other options I have considered are:

  1. Allow overlap and manually check for collisions and repositioning of playhead on change.
  2. Separate playhead from the start and end range and have playhead listen for changes to start and end to change its position if needed.

Thanks