zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
891 stars 232 forks source link

[BUG FIX] Update slider sizes without flickering the component #116

Closed Tzook closed 6 years ago

Tzook commented 6 years ago

Once the component renders, it calculates the slider sizes and positions. It does so in a timeout, which causes the slider to be rendered and re-rendered differently - which results in a small visual flicker. The timeout is needed only for actual resize events, so this behavior is kept. When the component mounts or updates, it does immediately without a timeout - this makes the component much more smooth and render beautifully.

mpowaga commented 6 years ago

Thanks for submitting this @Tzook! I needed to apply these changes in another commit (mainly to solve conflicts and improve the code slightly) but added your attribution.