FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3.02k stars 597 forks source link

fix: filter out null slides #953

Closed ValGeorgiev closed 1 year ago

ValGeorgiev commented 1 year ago

Description

When there is a condition to not render a particular slide, the library is rendering an empty slide. We need to filter out the null slides.

Fixes #951

Type of Change

How Has This Been Tested?

Checklist

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nuka-carousel ✅ Ready (Inspect) Visit Preview Aug 18, 2022 at 4:59PM (UTC)
fritz-c commented 1 year ago

This PR seems like a good candidate to add some tests. I've got a PR to fix the autoplay timing that introduces some integration tests using react-testing-library. If you don't mind waiting for that to get merged, maybe you can use that as a base for a simple integration test or two that makes sure slides are not rendered for null children.