Skip to content

bug(mat-expansion-panel): Stays visible even though it is within div with style.visibility=hidden #27436

Closed
@dcolak8figures

Description

@dcolak8figures

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

<div [style.visibility]="shouldBeVisible ? 'visible' : 'hidden'" [style.height]="selectedTab != 0 ? '100%' : '0px'">

<mat-accordion>
<mat-expansion-panel>
..content..
</mat-expansion-panel>
</mat-accordion>

</div>

  1. Expand one of the panels in accordion
  2. Set shouldBeVisible to false and hence div style to visibility:hidden
  3. Expanded panel is still visible, just grayed out
  4. The expansion-panel header is invisible, just as it should be

Reproduction

StackBlitz link:
Steps to reproduce:
1.
2.

Expected Behavior

Expanded panel should disappear completely if the div it's within is set to visibility:hidden

Actual Behavior

Expanded panel stays visible (and grayed out) when the DIV its mat-accordion control is in is set to visibility:hidden

Environment

Package Version

@angular-devkit/architect 0.1600.3
@angular-devkit/build-angular 16.0.3
@angular-devkit/core 15.2.8
@angular-devkit/schematics 16.0.3
@angular/cdk 16.0.2
@angular/material 16.0.2
@angular/pwa 15.2.8
@schematics/angular 16.0.3
rxjs 7.5.7
typescript 5.0.4

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions