preact-mdl
preact-mdl copied to clipboard
Slider duplicating on rerender
When I use the Slider component and a rerender happens (state or props change), then the slider will be duplicated.
Might possibly be the same error source as #7? (A problem with the remounting by mdl)
Minimal setup:
class SliderTest extends Component {
updateState = e => {
this.setState({
value: e.target.valueAsNumber
})
}
render(_, { value }) {
return (
<div>
<Slider name='test' min={0} max={100} value={value} onChange={this.updateState} />
</div>
)
}
}
After some changes will render this:

For an example see here: https://codesandbox.io/s/6wx9r52lw
I will try to tackle this myself as well, but I do not know if my prect / mdl knowledge is enough for that 😅 .
Maybe this is why the onInput callback doesn't seem to work for me? You can drag it a bit but then it hangs.
edit: Jumped the gun, don't think it's related, also I'm not getting this issue.