onSliderDragStart and onSliderDragEnd handlers affect onChange function parameters
designbyadrian opened this issue · 2 comments
designbyadrian commented
Steps to reproduce
Have onChange, onSliderDragStart, and onSliderDragEnd handlers on Rheostat component.
Drag a handle to new position.
Expected result
onChange is called with values [newValue, newValue]
Actual result
onChange is called with values [oldValue, oldValue]
designbyadrian commented
I had state changes in all three, which overwrote each other. My mistake.
handleChange = ({ values }) => {
this.setState({ values });
}
handleStart = () => {
this.setState({ dragging: true });
}
handleEnd = () => {
this.setState({ dragging: false });
}
designbyadrian commented
onSliderDragEnd
and onChange
collide. Use one or the other.