C
C
centerBel2016-09-08 15:48:06
JavaScript
centerBel, 2016-09-08 15:48:06

Is it possible to make it possible to navigate through the angular search results with the up and down keys?

There is a list

<input ng-model="searchText"></label>
<ul>
<li ng-repeat="friend in friends | filter:searchText">
</ul>

How can I make it possible to move up and down the elements of this list by pressing the corresponding keys on the keyboard?
Let's say we have a cursor in the input field, if it presses the down key, then we move to the first element from the list.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2016-09-08
@Sanasol

There is a TAB button for this.
And you don't even need to code.
And to determine the order of the elements, tabindex
is used. Well, or hang up a listener for pressing down / up and change the focus.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question