5

Bootstrap 3 panel title contains dropdown using code below. If dropdown is opened, up and down arrows do not move between items. How to enable dropdown navigation using up and down arrow keys ?

<div class="panel panel-success grid-panel-header">
    <div id='contentCaptionDiv' class="panel-heading">
        <div class="panel-title form-inline"> 
            <a class="btn" href="Show">
                <i class="fa fa-male" aria-hidden="true"></i>
            </a>
            <a class="btn" href="Delete">
                <i class="fa fa-female" aria-hidden="true"></i>
            </a>
        <div class="dropdown" type="button">
            <div class="dropdown-toggle" data-toggle="dropdown" role="button" href="#"> 
                <i class="glyphicon glyphicon-cog"></i>
                <span class="caret"></span>
            </div>
            <ul class="dropdown-menu" role="menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
            </ul>
          </div>
        </div>
    panel content here
</div>
Shehary
  • 9,926
  • 10
  • 42
  • 71
Andrus
  • 26,339
  • 60
  • 204
  • 378
  • 2
    maybe this can help you: http://stackoverflow.com/questions/15720107/how-to-make-bootstrap-button-dropdown-menu-selectable-by-keyboard – Luca_Rosario_Pappa Aug 29 '15 at 14:31
  • Adding `role='menu'` allows only donw arrow key to activete first dropdown item. Pressing up and down arrow keys after does not have any effect – Andrus Aug 29 '15 at 15:20
  • @Andrus You probably have something interfering with Bootstrap. This should work. Take a look here: http://jsfiddle.net/damphat/WJS9p/. Make sure you allow focus on the button (and probably on the subitems). – NoOne Oct 09 '15 at 18:05
  • 1
    One crazy reason I have found for this not to work is to omit the `href="#"` on the `
  • `. But you have them so that's not it...
  • – NoOne Oct 09 '15 at 19:09