2
downshift version: 5.2.7 
node version: 12.16.2 
yarn version:1.22.4

Using the following sandbox provided on Downshift JS's website: https://codesandbox.io/s/simple-downshift-with-getrootprops-example-24s13

I'm attempting to focus on the first item in the typeahead list as I filter with:

items.filter(item => !inputValue || item.label.toLowerCase().includes(inputValue.toLowerCase()))

The filter works, however, I'm unsure how to ensure that the item that most closely matches the input is focused on. I would like the user to be able to type in the input and be able to simply hit the 'enter' key to select the top most filtered item ( or closely matching item ) whilst typing. How would I do so with the Downshift package?

Delrog
  • 735
  • 2
  • 11
  • 27
  • Were you able to resolve this? I need this too. Please share a snippet if you do. Thanks – JP Calvo Apr 22 '22 at 13:19
  • You can use a state reducer to achieve this. I work in ClojureScript, so I can't give you the exact example, but basically you check if the type of state change was an input change, and then set the highlightedIndex to 0. – Henrik Aug 08 '22 at 08:54

0 Answers0