Skip to content

fix(material-experimental/mdc-autocomplete): panel losing max-height if menu is opened after autocomplete #21394

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
Jan 6, 2021
Merged
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
19 changes: 11 additions & 8 deletions src/material-experimental/mdc-autocomplete/autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

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

.mat-mdc-autocomplete-panel {
// Note that the `.mdc-menu-surface` is here in order to bump up the specificity
// and avoid interference with `mat-menu` which uses the same mixins from MDC.
.mdc-menu-surface.mat-mdc-autocomplete-panel {
width: 100%; // Ensures that the panel matches the overlay width.
max-height: 256px; // Prevents lists with a lot of option from growing too high.
position: static; // MDC uses `absolute` by default which will throw off our positioning.
Expand All @@ -28,13 +30,14 @@
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}

// These classes are used to toggle the panel's visibility depending on whether it has any options.
.mat-mdc-autocomplete-visible {
visibility: visible;
}
// These classes are used to toggle the panel visibility depending on whether it has any options.
&.mat-mdc-autocomplete-visible {
visibility: visible;
}

.mat-mdc-autocomplete-hidden {
visibility: hidden;
&.mat-mdc-autocomplete-hidden {
visibility: hidden;
}
}