Open jlo1 opened 6 years ago
a workaround is to set new min/max first and slider values afterwards:
this.setState({ sliderMax: NEW_MAX }, () => { this.setState({ sliderValue: VALUE }) })
this is not ideal but fixes the wrong behavior of the slider
@FelixMaulwurf You save my day, it did work
When both
maximumValue
andvalue
prop are adjusted, the thumb's position is set tovalue
on the old min/max slider track, then the slider's track adjusts to the newmaximumValue
. But order of events should occur the other way around.e.g. scenario: slider's initial props are set to
{:minimumValue 0 :maximumValue 100 :value 50}
update slider component props to{:value 100 :maximumValue 200}
current result: slider component draws the thumb at the end of the slider even though the max value is 200; and interacting with the slider will readjust slider's value to new min/max value (e.g. dragging left slightly will recalibrate the thumb's current position to be near the 200 mark)