<div class="navigation">
> <mat-tab-group disableRipple="true" selectedIndex="0">
> <mat-tab label="Label1"> </mat-tab>
> <mat-tab label="label 2"> </mat-tab>
> <mat-tab label="Label 3"> </mat-tab>
> </mat-tab-group>
> </div>
I have the above html code where I'm trying to set 'Label1' as the default tab. However, despite using selectedIndex="0", the active style is not being applied until I physically click on the tab.
When the tab is active, it should display a white color label. But this behavior is not observed when the tab is selected by default through selectedIndex="0".
For reference, I am working with Angular 7 and below are the CSS styles specific to Material Tabs in my component:
CSS Styles related to Material Tab:
.mat-ink-bar{
> background-color: #ffffff !important;
> border-bottom-color:solid #FFFFFF!important;
> width: 113px !important;
> height:4px !important;
> margin-left: 2rem;
> margin-bottom:0px;
>
> }
>
> .mat-tab-label, .mat-tab-label-active{
> color:#FFFFFF;
> background-color: transparent;
> font-family: "verdana";
> font-size: 20px;
> font-weight:500;
> max-width: 113px;
> padding: 0px;
> margin:0px;
> }
Your suggestions would be greatly appreciated. Thank you in advance for any help. Apologies for any formatting issues.