vhx / quartz-react

Quartz components using React
2 stars 1 forks source link

Improved performance of carousel when there are many slides #43

Closed sebastiansandqvist closed 7 years ago

sebastiansandqvist commented 7 years ago

This PR addresses performance issues with the Carousel component.

By having all slides "visible" at the same time (just hidden because of their negative z-index), the browser had to perform a lot of unnecessary calculations. This made the carousel unusable for a high number of elements. It also caused a single-frame flickering issue at large screen sizes.

I am not sure if this fixes the flickering issue completely, but in my tests it has.

I have also added a client-side load test to the demo with 50 slides. Prior to this fix I couldn't even scroll the page with that many slides.