Skip to content

fix(material/tabs): preserve parent labels after nested tab groups - #34186

Open
ect2000 wants to merge 1 commit into
angular:mainfrom
ect2000:fix/material-tabs-nested-label-order
Open

ect2000 wants to merge 1 commit into
angular:mainfrom
ect2000:fix/material-tabs-nested-label-order

Conversation

@ect2000

@ect2000 ect2000 commented Nov 25, 2026

Copy link
Copy Markdown

When a nested tab group appears before its parent tab's own mat-tab-label, the parent displays its fallback text. The existing safeguard rejects labels that belong to nested tabs, but the content query only returns the first match, so it never reaches the parent's label.

This change selects the first label owned by the current tab. It adds a regression test for a parent template declared after the nested group and keeps the existing test for a parent that only has a plain-text label.

The original plain-text-parent example in #10441 already works on main. This PR addresses the related ordering case, so I'm referencing the issue without closing it.

Testing: bazel test --lockfile_mode=off //src/material/tabs:unit_tests_chromium passed with 148 specs in Chromium. I also checked the failing and fixed behavior in a focused browser reproduction.

Prepared with assistance from Codex.

Select the first label owned by the tab even when a nested label comes earlier in the content query.

Refs angular#10441

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant