Skip to content

Commit 5d7c4c1

Browse files
committed
fix(menu): prevent menu from collapsing to less than one item
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.
1 parent 03a9a39 commit 5d7c4c1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/material/menu/menu.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ $mat-menu-submenu-indicator-size: 10px !default;
1313
border-radius: $mat-menu-border-radius;
1414
outline: 0;
1515

16+
// Give the menu a minimum height so that the user can't
17+
// collapse it to zero when they scroll away.
18+
min-height: $mat-menu-item-height + $mat-menu-vertical-padding * 2;
19+
1620
// Prevent users from interacting with the panel while it's animating. Note that
1721
// people won't be able to click through it, because the overlay pane will catch the click.
1822
// This fixes the following issues:

0 commit comments

Comments
 (0)