Home > Net >  directive to enable keyboard-navigation (using tab)
directive to enable keyboard-navigation (using tab)

Time:10-27

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>

CodePudding user response:

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.

  • Related