Skip to content

Commit fd04721

Browse files
authored
fix(material/expansion): panel content visible when placed inside a hidden parent (#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 #27436.
1 parent cb66d4f commit fd04721

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/material/expansion/expansion-animations.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ export const matExpansionAnimations: {
5656
/** Animation that expands and collapses the panel content. */
5757
bodyExpansion: trigger('bodyExpansion', [
5858
state('collapsed, void', style({height: '0px', visibility: 'hidden'})),
59-
state('expanded', style({height: '*', visibility: 'visible'})),
59+
// Clear the `visibility` while open, otherwise the content will be visible when placed in
60+
// a parent that's `visibility: hidden`, because `visibility` doesn't apply to descendants
61+
// that have a `visibility` of their own (see #27436).
62+
state('expanded', style({height: '*', visibility: ''})),
6063
transition(
6164
'expanded <=> collapsed, void => collapsed',
6265
animate(EXPANSION_PANEL_ANIMATION_TIMING),

0 commit comments

Comments
 (0)