Skip to content

bug(Tabs): Nested tabs with custom mat-tab-label template is wrongly applied to parent tab too #23558

Closed
@bjdash

Description

@bjdash

Reproduction

Use StackBlitz to reproduce your issue:
https://stackblitz.com/edit/angular-ra4b9y?file=src/app/tab-group-custom-label-example.html

Steps to reproduce:

  1. Run the stackblitz example and notice the parent tab now has label of the first child tab instead of its own label

Expected Behavior

The parent tab-group is using the default <mat-tab label="Parent 1"> to set its label. The child tab-group is using <ng-template mat-tab-label>Child 1</ng-template> . The ideal behavior in this situation would be for the first tab of the parent group to have a label of Parent 1

Actual Behavior

The first tab of the parent group is wrongly taking the label of its child tab group

Environment

  • Angular: 12
  • CDK/Material: 12
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tabs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions