Skip to content

Commit

Permalink
fix(menu): prevent menu from collapsing to less than one item (#15454)
Browse files Browse the repository at this point in the history
Currently we allow the menu it's height to collapse so that it becomes scrollable if it won't fit in the viewport, however this has the side effect that the user can make the menu go to zero height when they scroll away. These changes give the menu a minimum height so it doesn't happen.
  • Loading branch information
crisbeto authored and jelbourn committed May 13, 2019
1 parent d4579e6 commit 941a0d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/material/menu/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ $mat-menu-submenu-indicator-size: 10px !default;
border-radius: $mat-menu-border-radius;
outline: 0;

// Give the menu a minimum height so that the user can't
// collapse it to zero when they scroll away.
min-height: $mat-menu-item-height + $mat-menu-vertical-padding * 2;

// Prevent users from interacting with the panel while it's animating. Note that
// people won't be able to click through it, because the overlay pane will catch the click.
// This fixes the following issues:
Expand Down

0 comments on commit 941a0d9

Please sign in to comment.