Search bar suggestion dropdown
Anyone have any good resources for making a search bar that has a suggestions dropdown like what you see on Google or Youtube? My main issue is with somehow switching focus to the suggestions list, being able to navigate it with the keyboard, and having it populate the search bar when you hit enter.
Solution:Jump to solution
I think that you can keep the focus on the input, and watch for up and down arrow clicks and change some highlighted or selected state for the suggestions list, so something like this:
```jsx
function App () {
const [selected,setSelected] = useState(0);...
2 Replies
Solution
I think that you can keep the focus on the input, and watch for up and down arrow clicks and change some highlighted or selected state for the suggestions list, so something like this:
that actually makes a lot of sense. I guess I was overthinking it. Thank you!