Skip to content
Advertisement

directive to enable keyboard-navigation (using tab)

Hi I have this div which is skipped when we press tab, other UI elements come into focus but not this one, Which directive do I need to add to this so that it comes into focus when we navigate UI using keyboard

<div class="vertical-menu">       
  <a ng-class="{active: Page == 'homeview'}" ng-click="Page = 'homeview'">
    Home
  </a>    
</div>

Advertisement

Answer

There are html elements without tabindex enabled by default, and the div element is one of these.

To enable it, you must set the tabindex attribute to something >= 0:

<div tabindex="0"> ... </div>

Here you can find more information.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement