react-input-range
react-input-range copied to clipboard
Allow min and max to have same values
#55
Will also fix #85
Testing it out, I'm having trouble "unsetting" the case where the two sliders are both set to the max range.
Repro:
- Setup default config w/ range 0-10 and values
{min: 0, max: 10}
- Drag and set min to the max value (
10
) - Try sliding the slider back from the max val result Slider doesn't move Expected min slider can be moved back
This appears to be caused by the "max" slider catching the click event, and not letting it pass through to the min slider. I think that the following simple logic should fix this:
If `valMax === rangeMax && valMax === valMin` : pass event to minSlider
Does this need to be picked up again? I'd be happy to build from this PR. We are looking for the same functionality.