developit / developit/preact-mdl

Slider duplicating on rerender

Open
#49 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
192
Forks
20
PR merge metrics
No merged PRs in 30d

Description

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:
```jsx
class SliderTest extends Component {
updateState = e => {
this.setState({
value: e.target.valueAsNumber
})
}

render(_, { value }) {
return (




)
}
}
```

After some changes will render this:

![duplicatingslieders](https://user-images.githubusercontent.com/3578042/31829283-1941db90-b5bd-11e7-994e-3c7336de970e.png)

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 😅 .

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.