question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tabs: nested mat-tab-groups undesirably inherit @Inputs from parent

See original GitHub issue

Bug Report

Hey guys, I’m going crazy with this buggy feature of angular material. If you want to use a nested mat-tab-group inside of a mat-tab-group, which has background color of primary, all your child tab-groups gets the same background color. WHY the hell it happens???

Demo and steps to reproduce the issue

Take this example https://stackblitz.com/angular/oorxxxlyavb?file=src%2Fapp%2Ftab-group-basic-example.html or any other it doesn’t matter.

Add or replace the content with that

<mat-tab-group backgroundColor="primary">
  <mat-tab label="First">
    <mat-tab-group>
      <mat-tab label="First"> Content 1 </mat-tab>
      <mat-tab label="Second"> Content 2 </mat-tab>
      <mat-tab label="Third"> Content 3 </mat-tab>
    </mat-tab-group>
  </mat-tab>
  <mat-tab label="Second"> Content 2 </mat-tab>
  <mat-tab label="Third"> Content 3 </mat-tab>
</mat-tab-group>

AND SEE

The nested tab group should provide the default behavior, without background and colorized underline, because there is no property “backgroundColor”, BUT IT DOESN’T. Instead it gets the same background color like it’s parent.


We need either a fix for that unexpected behavior or a possibility to explicit unset the backgroundColor property.


Angular versions

  • Angular: 11.0.0
  • Angular Material: 11.0.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Splaktarcommented, Jan 10, 2021

Please submit Angular Material and CDK questions here and issues here. This repo is for AngularJS Material.

I have transferred this issue to the correct repository for you.

1reaction
crisbetocommented, Jan 10, 2021

This happens, because our selectors are too broad and it’s unintentional. It should be resolved by #21533.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nested Angular material tabs - Stack Overflow
This issue is being caused by the way label is being set for tab. You are setting label of parent with attribute label...
Read more >
Understanding Class Inheritance in Python 3 | DigitalOcean
This tutorial will go through some of the major aspects of inheritance in Python, including how parent classes and child classes work, ...
Read more >
Python Multiple Inheritance & super() init - DataCamp
Let's jump right into some code for an example. In the below code block we'll demonstrate inheritance with a Child class inheriting from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found