zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
890 stars 232 forks source link

Impossible to reach max/min with step #226

Closed Eliepse closed 3 years ago

Eliepse commented 3 years ago

Description

Hello,

I use this slider with min, max values et a step. I expect the values to be able to reach the minimum and the maximum, but if those limits does not match with the step, it's not possible to do it.

In my case, I have a slider with a step of 5, trying to select a range of dates between 2000 and 2022. you can check the sandbox below to try it out. :)

Thanks !

CodeSandbox

You can find an example with the problem here in the sandbox. I invite you to try to move the right handle to the maximum.

Edit zillow/react-slider

stonebk commented 3 years ago

This is currently expected behavior when using step. From the step documentation:

Value to be added or subtracted on each step the slider makes. Must be greater than zero. max - min should be evenly divisible by the step value.

Eliepse commented 3 years ago

Ok, my bad. Thank you for your time. :)

Not really practical though. :/