Skip to content
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

add allowsEmptyCollection property to ComboBoxProps interface #5842

Merged
merged 5 commits into from
Feb 23, 2024

Conversation

wdsjohn
Copy link
Contributor

@wdsjohn wdsjohn commented Feb 8, 2024

Workaround for #5690

It is already possible to provide allowsEmptyCollection as a prop to Combobox, but TypeScript will not be happy since its untyped.

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

Start storybook
Add allowsEmptyCollection={true} to e.g. ComboBoxAsyncLoadingExample story
Type in foo
Add 'f'
Remove 'f' and see that the menu remains open

If you set allowsEmptyCollection={false} or simply remove the prop you can see that when you remove 'f' that the menu will remain closed.

@LFDanLu
Copy link
Member

LFDanLu commented Feb 9, 2024

Thanks for the PR! I will be hopefully revisiting ComboBox soon and will let you know if we decide to expose this prop or not, but in the meantime would you mind signing the CLA: https://react-spectrum.adobe.com/contribute.html#contributor-license-agreement? That will get the build step passing

@wdsjohn wdsjohn closed this Feb 10, 2024
@wdsjohn wdsjohn reopened this Feb 10, 2024
@reidbarber
Copy link
Member

GET_BUILD

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

I think this should be fine as a stopgap solution until we can spend some time revisiting the internal logic for combobox, thanks!

@LFDanLu LFDanLu merged commit a0f0604 into adobe:main Feb 23, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants