Report this

What is the reason for this report?

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

Posted on December 18, 2020

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.



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!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.