Skip to content

Commit

Permalink
fix(material/expansion): panel content visible when placed inside a h…
Browse files Browse the repository at this point in the history
…idden parent (angular#27438)

The expansion panel was setting `visibility: visible` on the content which meant that it would be visible when placed inside of a parent that is `visibility: hidden`.

These changes resolve the issue by clear the `visibility` instead.

Fixes angular#27436.
  • Loading branch information
crisbeto authored and stephenrca committed Aug 2, 2023
1 parent 28899a1 commit 2c8a9f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/material/expansion/expansion-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export const matExpansionAnimations: {
/** Animation that expands and collapses the panel content. */
bodyExpansion: trigger('bodyExpansion', [
state('collapsed, void', style({height: '0px', visibility: 'hidden'})),
state('expanded', style({height: '*', visibility: 'visible'})),
// Clear the `visibility` while open, otherwise the content will be visible when placed in
// a parent that's `visibility: hidden`, because `visibility` doesn't apply to descendants
// that have a `visibility` of their own (see #27436).
state('expanded', style({height: '*', visibility: ''})),
transition(
'expanded <=> collapsed, void => collapsed',
animate(EXPANSION_PANEL_ANIMATION_TIMING),
Expand Down

0 comments on commit 2c8a9f7

Please sign in to comment.