How to show suggestion list based on input change? with Keyboard and mouse scrolling on suggestion list

I tried to make customize the search functionality with input and based on change value it will show different suggestion from database. but problem is after entering text i want to select suggestion with enter key press from keyboard. I tried lot but auto scroll is happening with mouse only.with keyboard it’s not working as we press arrow key up/down from keyboard. basically i want below attached tags and topics functionality.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It sounds like you are logging keyboard strokes as a way to update the auto-complete of your search box, so you may want to instead do it through a different element like the input box itself and use something like onChange which I think will react to the input in the search box, but not be affected by using the up and down arrow keys.

Alternatively you can also check out Algolia, as they provide a great managed search service, which does everything you are looking for.