I've got a navbar in our app that has a bunch of buttons that are links to other pages, and then a conditional logoff/logon button. That button is an <a>
, but it just has (click)
and no href
or routerLink
. As such, I can't tab to it. I added routerLink=""
which is working, but seems really hacky. Is there a class or something I can add to make it "tabbable"?
Here's the navbar as it was before I added that routerLink=""
:
<ul class="nav navbar-nav">
<li><a routerLink="/dashboard" routerLinkActive="active">Dashboard </a></li>
<li><a routerLink="/studentaccount" routerLinkActive="active">My Account</a></li>
<li><a routerLink="" (click)="logout()">Sign Out</a></li>
</ul>
Adding tabindex="0" should solve it. E.g.
<a routerLink="/dashboard" routerLinkActive="active" tabindex="0">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With