Skip to content

tabs: nested mat-tab with matTabContent directive does not work #11941

@MurhafSousli

Description

@MurhafSousli

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Nested mat-tab with <ng-template matTabContent> to work

What is the current behavior?

Nested mat-tab with <ng-template matTabContent> do not work

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-aqmcu4?file=app/app.component.html

Use <ng-template matTabContent> in both the outer and the inner mat-tab and the issue will occur

<mat-tab-group>

  <mat-tab label="tab1">
    <ng-template matTabContent>
      
      <mat-tab-group>
        <mat-tab label="child tab1">
          <ng-template matTabContent>
            <p>Test Test Test Test Test Test Test Test Test Test Test Test</p>
          </ng-template>
        </mat-tab>

        <mat-tab label="child tab2">
          <ng-template matTabContent>
            <p>Test Test Test Test Test Test Test Test Test Test Test Test</p>
          </ng-template>
        </mat-tab>
      </mat-tab-group>

    </ng-template>
  </mat-tab>

  <mat-tab label="tab2">
    <ng-template matTabContent>
      <p>Test Test Test Test Test Test Test Test Test Test Test Test</p>
    </ng-template>
  </mat-tab>

  <mat-tab label="tab3">
    <ng-template matTabContent>
      <p>Test Test Test Test Test Test Test Test Test Test Test Test</p>
    </ng-template>
  </mat-tab>

</mat-tab-group>

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 6.0.0
Material 6.3.0

Is there anything else we should know?

If <ng-template matTabContent> is removed from the inner mat-tab, it works

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: material/tabs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions