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

Posted December 18, 2020 190 views

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.

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.

Submit an Answer
1 answer

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.