Skip to content

Commit 4fe3424

Browse files
committed
fix(material/form-field): ensure same stacking context as container
When `will-change` was removed in #27251, the form field lost its implicit stacking context which means that some of its descendants may be stacked on top of the container. These changes add an explicit `z-index` on the container to resolve the issue. Fixes #28708.
1 parent 9509ad5 commit 4fe3424

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/material/form-field/form-field.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ $_icon-prefix-infix-padding: 4px;
8484
min-width: 0;
8585
// To avoid problems with text-align.
8686
text-align: left;
87+
// Avoids stacking issues due to the absolutely-positioned
88+
// descendants of the form field (see #28708)
89+
position: relative;
90+
z-index: 0;
8791

8892
[dir='rtl'] & {
8993
text-align: right;
@@ -139,7 +143,7 @@ $_icon-prefix-infix-padding: 4px;
139143
// MDC applies `pointer-events: none` to the `.mdc-text-field--disabled`. This breaks clicking on
140144
// prefix and suffix buttons, so we override `pointer-events` to always allow clicking.
141145
pointer-events: auto;
142-
// Needs a z-index to ensure it's on top of other content clickable. See #27043.
146+
// Needs a z-index to ensure it's on top of other clickable content. See #27043.
143147
position: relative;
144148
z-index: 1;
145149

0 commit comments

Comments
 (0)