You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing issues with the keyboard navigation through the command items if I don't include the CommandInput. Basically I need the entire functionality of a combobox but in some cases, there's no need for Search input (eg. design requires when there are 3 items only, no need to search through them). When I interact with the items with the mouse (hover / click) all is good, but if I attempt to navigate by keyboard only, it just doesn't work. When opening the command, the first item seems to be "selected=true" but when pressing down arrow it doesn't move to the next item.
It seems like it's a focus issue, because if I click the scrollbar of the combobox and then I start again using the up/down arrows, it works.
Encountered this problem as well. As a temporary solution, I added a tabIndex={0} in <CommandItem/>.
You can now use enter to select but not space. I tried overriding it using the onKeyDown attribute but couldn't get it to work. I also think it's a focus problem.
I've also came with an workaround (in case it'll be useful to anyone): when no search input, added a custom button auto focused which would be hidden for screen readers but will initiate the focus in the combobox list
Hi,
I'm facing issues with the keyboard navigation through the command items if I don't include the CommandInput. Basically I need the entire functionality of a combobox but in some cases, there's no need for Search input (eg. design requires when there are 3 items only, no need to search through them). When I interact with the items with the mouse (hover / click) all is good, but if I attempt to navigate by keyboard only, it just doesn't work. When opening the command, the first item seems to be "selected=true" but when pressing down arrow it doesn't move to the next item.
It seems like it's a focus issue, because if I click the scrollbar of the combobox and then I start again using the up/down arrows, it works.
This is a basic implementation (using shadcnui):
Any suggestion would be highly appreciated!
The text was updated successfully, but these errors were encountered: