react-input-range
react-input-range copied to clipboard
Using the keyboard exceed the max or min values
When I tried to control the keyboard to change the values of "Range" component, I could exceed the max and min values.
I couldn't produce the same issue. It was fixed in some later version?
No, this issue it still open. Just tried to take the example from "usage" to accept min/max value, In case using the keyboard only, when reaching the max/min value and keep clicking on the arrow key, the value still getting higher/lower although the limit of the max/min props.
Can you provide the code that produced the issue?
Happens on multi value slider, due to missing parens following allowSameValue PR. We are sending a PR with @Lacourvincent to fix this and another bug on slider mouse dragging
I think, i have same issue. But i can reproduce this, only when using redux-form. https://codesandbox.io/s/14z7mr2mw3
Fix in my project:
const params = {
minValue: 9,
maxValue: 18,
step: 0.5,
onChange: value => {
const min = value.min < params.minValue ? params.minValue : value.min
const max = value.max > params.maxValue ? params.maxValue : value.max
const isIntervalTimeOk = max - min >= 3
return isIntervalTimeOk && onChange({ min, max }) // onChange of redux input field
}
}
<InputRange draggableTrack { ...params } />