4

I am using bootstrap's dropdown toggle directive. But I could navigate the menus thru mouse but not thru the keyboard arrow key. Please let me know how to navigate thru keyboard up/down arrow keys.

See this plunker: http://plnkr.co/edit/m5TBlkVMVJHVF69V2635?p=preview

1 Answer 1

6

For Bootstrap dropdowns, the up/down arrows rely on being able to "focus" the anchors, which requires the href attribute be specified.

<ul class="dropdown-menu">
  <li ng-repeat="choice in items">
    <a href="javascript:void(0)">{{choice}}</a>
  </li>
</ul>

Note use of href="javascript:void(0)" instead of the usual href="#", because the latter will cause AngularJS to reload the page due to the route changing.

Sign up to request clarification or add additional context in comments.

1 Comment

Solution proposed by Peter Davis works. Should be the accepted answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.