-
-
Notifications
You must be signed in to change notification settings - Fork 352
fix: support flex-based sizing without explicit width/height #877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Handle viewSize=0 in useVisibleRanges to prevent division by zero - Initialize displayedItems with sensible defaults in ItemRenderer - Add tests for viewSize boundary conditions and sizing scenarios - Add "Sizing Your Carousel" documentation section Fixes #668
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #877 +/- ##
==========================================
+ Coverage 81.90% 82.38% +0.47%
==========================================
Files 35 35
Lines 1006 1016 +10
Branches 339 346 +7
==========================================
+ Hits 824 837 +13
Misses 81 81
+ Partials 101 98 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
This PR fixes the issue where Carousel would not render when using
style={{ flex: 1 }}without explicit width/height values.Changes
useVisibleRanges.tsx: HandleviewSize <= 0to prevent division by zero and return sensible default rangesItemRenderer.tsx: InitializedisplayedItemswith sensible defaults instead of null to ensure items render on first frameviewSizeboundary conditions (0, negative values)How to Use
Now users can use flex-based sizing:
Or explicit dimensions:
Fixes #668