From eaa60992627d668c231ec1db76d348daf5f5bd10 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 27 Jul 2017 19:43:57 +0300 Subject: [PATCH] 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. --- src/lib/menu/menu.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/menu/menu.scss b/src/lib/menu/menu.scss index e944496b563..f3e6d879843 100644 --- a/src/lib/menu/menu.scss +++ b/src/lib/menu/menu.scss @@ -15,6 +15,13 @@ $mat-menu-border-radius: 2px !default; max-height: calc(100vh - #{$mat-menu-item-height}); border-radius: $mat-menu-border-radius; + // Prevent the user from interacting while the panel is still animating. + // This avoids issues where the user could accidentally open a sub-menu, + // because of the `overlapTrigger` option. + &.ng-animating { + pointer-events: none; + } + @include cdk-high-contrast { outline: solid 1px; }