Skip to content

feat: add maxHorizontalSpace prop to WaterfallLayout #8731

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

Merged
merged 3 commits into from
Aug 18, 2025

Conversation

yihuiliao
Copy link
Member

@yihuiliao yihuiliao commented Aug 15, 2025

RSP Component Milestones (view)

seems like we also prioritized minItemSize.width > maxItemSize.width so having the min take precedence of over the max seems appropriate when min > max.

you can use the VirtualizedListBoxWaterfallStory to test, i'd recommend setting the maxColumns between 3 to 5 and then messing around with the minSpace + maxSpace

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Aug 15, 2025

@rspbot
Copy link

rspbot commented Aug 15, 2025

@rspbot
Copy link

rspbot commented Aug 15, 2025

## API Changes

react-aria-components

/react-aria-components:WaterfallLayoutOptions

 WaterfallLayoutOptions {
   dropIndicatorThickness?: number = 2
   maxColumns?: number = Infinity
+  maxHorizontalSpace?: number = Infinity
   maxItemSize?: Size = Infinity
   minItemSize?: Size = 200 x 200
   minSpace?: Size = 18 x 18
 }

@react-stately/layout

/@react-stately/layout:WaterfallLayoutOptions

 WaterfallLayoutOptions {
   dropIndicatorThickness?: number = 2
   maxColumns?: number = Infinity
+  maxHorizontalSpace?: number = Infinity
   maxItemSize?: Size = Infinity
   minItemSize?: Size = 200 x 200
   minSpace?: Size = 18 x 18
 }

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yihuiliao yihuiliao added this pull request to the merge queue Aug 18, 2025
Merged via the queue into main with commit 7a8c11a Aug 18, 2025
33 checks passed
@yihuiliao yihuiliao deleted the maxspace-waterfall-layout branch August 18, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants