Skip to content

mat-tab-group doesn't show styles for default tab selected #9540

Closed

Description

@ATakaSKY

What is the current behavior?

There are three tabs:label1, label2 and label3. Inside each one of them there is another set of tabs. Now by default label1 shows the selected style as well as tab1 inside of it. Now once I click on another label like label 2 another set of tab loads but none of them shows tab label highlighted. Same goes for label3. I explicitly have to click on the tabs to see the styles.

What is the expected behavior?

Tab labels inside of label 2 and label 3 should also show highlighted tab labels.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-tyjslw?file=app/tabs-template-label-example.html

Activity

  1. changed the title [-]mat-tab-group doesn't show default tab [/-] [+]mat-tab-group doesn't show styles for default tab selected[/+] on Jan 23, 2018
  2. MNorgren commented on Feb 16, 2018

    @MNorgren

    I am also having this issue. Seems like when visibility is toggled, the styles aren't being applied. Ive tried using a .hide class instead of *ngIf, but that doesnt fix it either. Any current workarounds that anyone knows of?

  3. amcdnl commented on Feb 18, 2018

    @amcdnl
    Contributor

    Explanation: Tab content is eagerly loaded by default. The tabs use dom size/position calculations for animations, since the tabs are loaded when the content is not visible it causes this side effect. This can be resolved by lazy loading the tabs which is capable as of: #8921

  4. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions