Skip to content

Conversation

devongovett
Copy link
Member

Closes #8884, closes #8831

The onAction prop is accepted by ListBoxItem / ComboBoxItem in S2 but doesn't actually work with the keyboard. This PR fixes that so it works like links, where actionable items are not selectable.

Also adds docs for both RAC and S2 for the commonly requested use case of adding a "Create" action to a ComboBox.

return (
<ComboBox
label="Favorite Animal"
allowsEmptyCollection
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately this is currently required or the ComboBox will close due to the collection double render. inputValue updates and we filter again against the old collection, which will now be empty due to the old item being filtered out, so the combobox closes. then on the next render the collection updates but it's too late. Not sure of a good way to fix that automatically other than adding this prop, but it's a bit non-obvious.

@rspbot
Copy link

rspbot commented Sep 23, 2025

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.

onCreateItem for ComboBox Expose ComboBoxContext to ListBoxItem
3 participants