Skip to content

fix: properly render empty state when filtering S2 ComboBox with sections #8735

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 1 commit into from
Aug 20, 2025

Conversation

LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Aug 19, 2025

From testing

✅ 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:

Try filtering a S2 combobox that has sections and ensure that the empty state will appear properly.

🧢 Your Project:

RSP

@rspbot
Copy link

rspbot commented Aug 19, 2025

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

@@ -27,7 +27,7 @@ const meta: Meta<typeof ComboBox<any>> = {
},
tags: ['autodocs'],
argTypes: {
...categorizeArgTypes('Events', ['onInputChange', 'onOpenChange', 'onSelectionChange']),
...categorizeArgTypes('Events', ['onInputChange', 'onOpenChange', 'onSelectionChange', 'onLoadMore']),
Copy link
Member Author

Choose a reason for hiding this comment

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

didn't realize we had to do this for any action handlers due to storybook 8 making implicit actions error...

Copy link
Member

Choose a reason for hiding this comment

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

yeah... it's awful :(

Comment on lines +55 to +60
// Only count sections and items when determining size so that
// loaders and separators in RAC/S2 don't influence the emptyState determination
if (node.type === 'section' || node.type === 'item') {
size++;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

this shouldn't affect v3 theoretically since there wasn't a concept of loader/separator nodes

@snowystinger
Copy link
Member

Did you want any tests for this?

@devongovett devongovett added this pull request to the merge queue Aug 20, 2025
Merged via the queue into main with commit 216cd6d Aug 20, 2025
32 checks passed
@devongovett devongovett deleted the combobox_fixes branch August 20, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants