MatTabNavBar not showing arrows

2.7k views Asked by At

I've noticed that the MatTabNavBar is behaving different from a regular MatTabGroup when it comes to showing the arrows if the container gets too small for the tabs.

I used the official documentation to build the MatTabNavBar and MatTabGroup, but you can see here that the MatTabGroup is showing arrows and the MatTabNavBar is not.

https://angular-gaio5u.stackblitz.io

Template used for MatTabGroup:

<mat-tab-group>
  <mat-tab
    *ngFor="let tab of tabs"
    [label]="tab.label"
  >
    {{ tab.label }}
  </mat-tab>
</mat-tab-group>

Template used for MatTabNavBar:

<nav mat-tab-nav-bar>
  <a
    mat-tab-link
    *ngFor="let tab of tabs"
    [active]="isActive(tab)"
    (click)="setActive(tab)"
  >
    {{ tab.label }}
  </a>
</nav>

...so am I missing anything?! The expected result is the MatTabNavBar showing the same arrows as MatTabGroup.

2

There are 2 answers

0
Ben Winding On

FYI, this seems to be fixed in versions @angular/[email protected] and newer.

0
vaibhav thakur On
        <mat-tab-group class="mat-tab-header mat-tab-header-pagination-controls-enabled" mat-align-tabs="center" #tabs (selectedTabChange)="onTabPanelClick($event, $event.tab)">

Note Ad this -> class="mat-tab-header mat-tab-header-pagination-controls-enabled"