javascript - Zhihu search box still has focus even when there is a drop-down menu. Why?
漂亮男人
漂亮男人 2017-05-19 10:10:28
0
1
1105

When using the up and down keys to scroll the drop-down menu, the input focus is still retained in the search box. How to do this?

漂亮男人
漂亮男人

reply all(1)
左手右手慢动作

Because the focus should always be on the search box, listening for input keyboard events,
when the direction key is pressed, it is handed over to the drop-down menu management. The drop-down menu calculates the index according to the direction, and adds the activation style to the corresponding entry

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template