Skip to content

Commit 3d39db5

Browse files
crisbetoandrewseguin
authored andcommitted
fix(menu): open animation not working on repeat opens (#20382)
This seems to be a remnant of the old menu animation. Previously when a menu was opened, we had a two step animation: scale and fade in the panel and then fade in the items a little bit later. When the latest Material design spec update was implemented, the animation was simplified to a fade in and scale only, however some of the metadata doesn't seem to have been cleaned up which is causing an issue where we set an `opacity` on the items when we close the panel for the first time, but there's nothing resetting it the next time around which ends up causing the entire animation to be skipped. Fixes #20379. (cherry picked from commit ea628c9)
1 parent fbc6e2a commit 3d39db5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/material/menu/menu-animations.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import{
1212
style,
1313
animate,
1414
transition,
15-
query,
16-
group,
1715
AnimationTriggerMetadata,
1816
} from '@angular/animations';
1917

@@ -40,12 +38,10 @@ export const matMenuAnimations: {
4038
opacity: 0,
4139
transform: 'scale(0.8)'
4240
})),
43-
transition('void => enter', group([
44-
query('.mat-menu-content, .mat-mdc-menu-content', animate('100ms linear', style({
45-
opacity: 1
46-
}))),
47-
animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({transform: 'scale(1)'})),
48-
])),
41+
transition('void => enter', animate('120ms cubic-bezier(0, 0, 0.2, 1)', style({
42+
opacity: 1,
43+
transform: 'scale(1)'
44+
}))),
4945
transition('* => void', animate('100ms 25ms linear', style({opacity: 0})))
5046
]),
5147

0 commit comments

Comments
 (0)