Skip to content

Commit c530067

Browse files
authored
fix(material-experimental/mdc-select): panel losing max-height if menu is opened after select (#21341)
If an MDC-based `mat-menu` is opened after a `mat-select`, the select will lose its `max-height`, because its selector specificity is too low and it gets overwritten by the menu which uses the same set of mixins. These changes resolve the issue by increasing the specificity.
1 parent eb32025 commit c530067

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/material-experimental/mdc-select/select.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ $scale: 0.75 !default;
6868
margin: 0 $mat-select-arrow-margin;
6969
}
7070

71-
.mat-mdc-select-panel {
71+
// Note that the `.mdc-menu-surface` is here in order to bump up the specificity
72+
// and avoid interference with `mat-menu` which uses the same mixins from MDC.
73+
.mdc-menu-surface.mat-mdc-select-panel {
7274
width: 100%; // Ensures that the panel matches the overlay width.
7375
max-height: $mat-select-panel-max-height;
7476
position: static; // MDC uses `absolute` by default which will throw off our positioning.

0 commit comments

Comments
 (0)