Skip to content

Commit eaa6099

Browse files
crisbetoandrewseguin
authored andcommitted
fix(menu): prevent user from accidentally opening a sub-menu while animating (#5996)
Makes the menu panel non-interactive while it is animating, preventing the user from accidentally triggering a sub-menu.
1 parent 59319d0 commit eaa6099

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib/menu/menu.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ $mat-menu-border-radius: 2px !default;
1515
max-height: calc(100vh - #{$mat-menu-item-height});
1616
border-radius: $mat-menu-border-radius;
1717

18+
// Prevent the user from interacting while the panel is still animating.
19+
// This avoids issues where the user could accidentally open a sub-menu,
20+
// because of the `overlapTrigger` option.
21+
&.ng-animating {
22+
pointer-events: none;
23+
}
24+
1825
@include cdk-high-contrast {
1926
outline: solid 1px;
2027
}

0 commit comments

Comments
 (0)