Skip to content

Commit 6dcd535

Browse files
committed
fix(material/autocomplete): empty autocomplete obscuring content
When the select doesn't have any content, it becomes hidden however the overlay is still attached which can obscure content right under the input.
1 parent b33af6b commit 6dcd535

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/material/autocomplete/autocomplete.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ div.mat-mdc-autocomplete-panel {
4343
&.mat-mdc-autocomplete-visible {
4444
visibility: visible;
4545
}
46+
}
4647

47-
&.mat-mdc-autocomplete-hidden {
48-
visibility: hidden;
49-
pointer-events: none;
50-
}
48+
div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,
49+
.cdk-overlay-pane:has(.mat-mdc-autocomplete-hidden) {
50+
visibility: hidden;
51+
pointer-events: none;
52+
}
53+
54+
.cdk-overlay-pane:has(.mat-mdc-autocomplete-hidden) {
55+
background: red;
5156
}
5257

5358
@keyframes _mat-autocomplete-enter {

0 commit comments

Comments
 (0)