Replies: 1 comment 7 replies
-
I think you'll want to use a Combobox, but just clear the input and selection once an item is selected. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What would be the best way to build a menu with a search field using using
react-aria-component
?You can see what I mean in the example of Notion. This is very similar to combobox but here the input field is kind of attached to the list and does not contain the current selected value but rather acts like a search field for menu items. I tried to just put a simple input alongside menu items but when you hover menu items the focus moves away from the input. But we'd like to have the focus on input even when you hover and navigate menu items with arrow keys. I also tried to patch the
MenuItem
component to pass downshouldUseVirtualFocus
touseMenuItem
but then the keydown events are not propagated to the menu element when the input is focused.CleanShot.2023-10-27.at.12.48.55.mp4
Beta Was this translation helpful? Give feedback.
All reactions