pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.17k stars 262 forks source link

When searching, first item in list of filtered results is selected #144

Open stevecastaneda opened 1 year ago

stevecastaneda commented 1 year ago

Instead of filtering the rendered list when searching, I'd like to select the 1st result of a search. I love this because I can still traverse a list using the keyboard. Is this possible with cmdk?

  1. I can type "1"
  2. Press down
  3. Select 1:30am

2023-06-03 13 20 37

stevecastaneda commented 1 year ago

Maybe if Command.Group had the ability to accept a key for the Command.Item that should be focused/selected in the list? Then when you press enter, it selects it as the input value.