You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tabs
A <md-expansion-panel [expanded]="false"> should not be expanded until explicitally opened.
When inside a hidden tab, .mat-expansion-panel-content should have height : 0px
What is the current behavior?
Panel is collapsed but panetl's content is visible. Problem occurs only if the accordion is in a hidden tab of a tab-group.
<md-tab label="Working">
<md-accordion>
<md-expansion-panel [expanded]="false">
<md-expansion-panel-header>
You should see me
</md-expansion-panel-header>
<p>Yous should not see me</p>
</md-expansion-panel>
</md-accordion>
</md-tab>
<md-tab label="Not working">
<md-accordion>
<md-expansion-panel [expanded]="false">
<md-expansion-panel-header>
You should see me
</md-expansion-panel-header>
<p>Yous should not see me</p>
</md-expansion-panel>
</md-accordion>
</md-tab>
</md-tab-group>
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material2 master
Angular 4.2.3
Reacted by nascosto, Alintya, MoleculeBoy, kevin Vanhove, Murhaf Sousli, Michele Schäuble, Marc, darkurse, Gabriel Boudreau, Reza Qorbani and 49 more
This actually happens to anything that contains an animation when set inside a hidden md-tab.
Reacted by Daniel Muller, Brandon Ayers, Martin Sileno, Ivan, Amir Mohtasebi, Kyle Kirst, Alexandr Gerasimenko, Nick Tobolski, jujyfruits, Markus Mohoritsch and 4 more
😉 A very unacceptable workaround (but useful if you can't wait for the next release, possibly without this bug) is using a *ngIf and just show the accordion/expansion panel when it's needed (if it's needed when the page is loaded, put a variable in a setTimeout to trigger *ngIf in about 4 to 5 seconds after the tab-group has been rendered, or use the tab change event). In this case the expansion is shown in its expected state (collapsed or expanded).
Reacted by Juliano Brasil, Robert Reichhold-Hahn, Kea Barnes, Steve Todorov, Lorenzo Cioni, John Rood, Srikanth Rayabhagi, Murhaf Sousli, Alexandr, darkurse and 37 more
Reacted by yony salgado and Tor
Reacted by Kea Barnes, suvonkar, Alexandr, Nalin Mathur, Jesse, Leo Caseiro, Kevin Tong, xeax, Gauravbhai Daxini, Tommy Gaessler and 6 more
Reacted by Kevin Tong, Tommy Gaessler, yony salgado, Nenad Ralić and Tor
by the way.. you can easily confirm issue resolved by going to my demo for this issue, see it as it is, update dependencies, reload - and see everything works fine!
GThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tabs
Activity
[-]md-expansion-panel : started collapsed[/-][+]md-expansion-panel : start collapsed[/+]julianobrasil commentedon Jun 21, 2017
It seems to be working correctly here: http://plnkr.co/edit/q6kXPH?p=preview
AlanCrevon commentedon Jun 21, 2017
correct. It's also working in another page of mine. Currently trying to isolate the pb.
AlanCrevon commentedon Jun 21, 2017
Ok, i edit the issue : the problem occurs only if the element is in a hidden tab. Thanks @julianobrasil
[-]md-expansion-panel : start collapsed[/-][+]md-expansion-panel : collapsed in tabs[/+]julianobrasil commentedon Jun 21, 2017
OK. Updated the plunker to reproduce it: http://plnkr.co/edit/q6kXPH?p=preview
Put it in the issue.
emoralesb05 commentedon Jun 21, 2017
This actually happens to anything that contains an animation when set inside a hidden md-tab.
mzernetsch commentedon Jun 21, 2017
This seems to be caused by angular 4.2 changes.
I use Teradata Covalent expansion panels in my app which have the same problem since the new angular version: https://gitter.im/Teradata/covalent?at=593e58f06549436c7d3c8360
julianobrasil commentedon Jun 28, 2017
😉 A very unacceptable workaround (but useful if you can't wait for the next release, possibly without this bug) is using a *ngIf and just show the accordion/expansion panel when it's needed (if it's needed when the page is loaded, put a variable in a
setTimeoutto trigger*ngIfin about 4 to 5 seconds after the tab-group has been rendered, or use the tab change event). In this case the expansion is shown in its expected state (collapsed or expanded).lebeker commentedon Aug 31, 2017
Hey! that bug is really annoying, is there any hope to see it's fix?) Maybe applying @julianobrasil solution with *ngIf=isActive on tabs content?
julianobrasil commentedon Aug 31, 2017
@lebeker, I've been using something like that in a project: http://plnkr.co/edit/YAi6Xb?p=preview
I tried isActive (
*ngIf="mdTab.isActive"where mdTab is a reference template variable), but it causes a "changed after checked" error.lula commentedon Sep 1, 2017
Hello! @julianobrasil, following @lebeker advice that's working for me as a workaround:
Puresoft commentedon Sep 5, 2017
@lula worked for me, thanks!
michalmw commentedon Sep 11, 2017
@lula Can you show your component.ts file?
91 remaining items
jonyadamit commentedon Dec 23, 2018
by the way.. you can easily confirm issue resolved by going to my demo for this issue, see it as it is, update dependencies, reload - and see everything works fine!
hijazikaram commentedon Jan 23, 2019
im still having the issue
ignacionoguerol commentedon Jan 29, 2019
I just fixed it by lazy loading the non-default tab.
https://material.angular.io/components/tabs/overview#lazy-loading
zahasoftware commentedon Feb 20, 2019
6/7
Applying your own animations does not work, where you put the animation the control disappears
ThomasAdr commentedon Jul 31, 2019
Issue still exists in version 8.
Sieabah commentedon Aug 3, 2019
When will this library be comparable to the material-ui that react has?
React currently has a better material component library than Google's own material library
shlomoa commentedon Oct 7, 2019
This is not specific to MatTab, it is happening when accordion is embedded
Also in MatTree MatTable etc.
philipschikora commentedon Nov 13, 2019
+1
chaitraRastogi commentedon Apr 21, 2020
This worked for me
:host /deep/ .mat-expansion-panel-content:not(.mat-expanded) {
height: 0;
visibility: hidden;
}
:host
/deep/
.mat-expansion-panel-header:active
If we don't want to upgrade the angular version
mmalerba commentedon Dec 2, 2022
Confirmed that this work in v15 https://stackblitz.com/edit/angular-pmsgwg
angular-automatic-lock-bot commentedon Jan 2, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.