Skip to content

Commit 385e811

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 f1b13a2 commit 385e811

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/menu/menu.scss

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

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

0 commit comments

Comments
 (0)