问题
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.
回答1:
FYI, this seems to be fixed in versions @angular/material@8.2.x
and newer.
来源:https://stackoverflow.com/questions/53221503/mattabnavbar-not-showing-arrows