Skip to content

Commit

Permalink
fix(material/menu): prevent mat-menu from affecting flex layout (#21246)
Browse files Browse the repository at this point in the history
(cherry picked from commit 510672e)
  • Loading branch information
annieyw committed Feb 7, 2021
1 parent fd75a47 commit 1c16d91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/material-experimental/mdc-menu/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

@include mdc-menu-surface-core-styles($query: structure);

// Prevent rendering mat-menu as it can affect the flex layout.
mat-menu {
display: none;
}

.mat-mdc-menu-content {
// Note that we include this private mixin, because the public
// one adds a bunch of styles that we aren't using for the menu.
Expand Down
5 changes: 5 additions & 0 deletions src/material/menu/menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ $mat-menu-vertical-padding: 8px !default;
$mat-menu-border-radius: 4px !default;
$mat-menu-submenu-indicator-size: 10px !default;

// Prevent rendering mat-menu as it can affect the flex layout.
mat-menu {
display: none;
}

.mat-menu-panel {
@include mat-menu-base();
max-height: calc(100vh - #{$mat-menu-item-height});
Expand Down

0 comments on commit 1c16d91

Please sign in to comment.