Closed jshthornton closed 6 years ago
Can confirm!
+1
+1
Same.
Ugly workaround for controlled slider:
const defaultValues = [20, 30, 40]
class Home extends React.Component {
constructor () {
super()
this.state = { value: defaultValues }
}
componentDidMount () {
setTimeout(() => this.setState({
value: defaultValues
}), 1)
}
render () {
<ReactSlider value={this.state.value} onChange={value => this.setState({value})}>
<div className="my-handle">1</div>
<div className="my-handle">2</div>
<div className="my-handle">3</div>
</ReactSlider>
}
}
@mpowaga do you have plans on updating to v16 in the near future?
This is happening for me too!
As an alternative to @martinschnurer's workaround if you are using props instead of state, or if you just want to avoid referencing your initial state twice, you can just do this on your component:
componentDidMount () {
setTimeout(() => this.forceUpdate(), 1)
}
See https://github.com/mpowaga/react-slider/pull/114 for a fix
Fixed in version 0.10.0.
When using react 16 the handle does not start at the position you give it.
For example:
The handle will be at 0 and not draggable until you click on the bar.