tabs: nested mat-tab with matTabContent directive does not work
See original GitHub issueBug, 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Multiple nested dynamic Formgroups in multiple nested tabs
How can I achieve that every form in his own tab got an own reference to a Formgroup, which are dynamically generated? I've...
Read more >Tabs - Angular Material
Angular Material tabs organize content into separate views where only one view can be visible at a time. Each tab's label is shown...
Read more >Angular material tabs with lazy loaded routes - Zoaib Khan
Our tab sections need routes! The other problem with using the angular material tabs component is that we cannot link tab content to...
Read more >Create a dynamic tab component with Angular | juri.dev
Note: we cannot reuse the same @ContentChildren mechanism because it only works for projected content which has to happen statically. Our tabs ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@robertmazzo nesting a mat-tab-group inside a mat-tab still breaks it… using your example, but updating the dynamic tabs with this will break
I just tried adding nested mat-tab directives unsuccessfully. Any news on this ? thanks.