Skip to content

fix(material/menu): prevent mat-menu from affecting flex layout #21246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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