How to make Dropdown list with ability to select item with arrows and cursor?

In General, made so that when entering text the bottom fell out Dropdown, and when you fire the item it is highlighted using :hover, and clicking the mouse it is transferred to input.

Arrow I ~ present, what to do while in input you need to listen to the arrows.

Well, with the release of the current element barely know what to do. Maybe I should abandon the :hover and to insert the correct class. Well, here's how I determine the item on the cursor or the selected arrows, which he would attach the class?
March 23rd 20 at 18:51
1 answer
March 23rd 20 at 18:53
Well, here's how I determine the item on the cursor or the selected arrows, which he would attach the class?

well, with a mouse - using mouseover, obviously. and arrow... well, I would try to hang a change of block on the "keydown" and selection to "keyup". then when clicking you will move to the next block, and releasing the arrow - selection.

Find more questions by tags Angular