Closed dayaki closed 5 years ago
@dayaki , thanks for your question. So you want to set the min to 40 and max to 80. But allow user to slide the lower thumb to left and change the min value?
@githuboftigran Yes, users should be able to slide the left and right thumb higher or lower than the initial value
@dayaki I don't really understand why you need to change the minimum and maximum values while user slides thumbs, but if I understood correctly, you can set min and max in state when the value is changed:
const { min, max } = this.state;
<RangeSlider
style={{width: 160, height: 80}}
min={min}
max={max}
onValueChanged={(low, high) => {
if (low == min) { // Reached the minimum value
low = min - step;
}
if (high == max) { // Reached the maximum value
high = max + step;
}
this.setState({min: low, max: high});
}}/>
/>
@dayaki I'm closing this issue, because:
Hi, thanks for the package but am wondering if its possible to programatically set the values of the min and max range?
Say the min={20} and max={80}, how do I set it that it starts at 40 but the user can move min back to 20 if they want.