Skip to content

Commit f2d2c19

Browse files
authored
refactor(material-experimental/mdc-form-field): unset MDC custom baseline adjustment (#18892)
Recently with b2e8691, we updated to the latest canary version of the MDC text-field. MDC updated how they align the input vertically. We decided to still use our custom alignment using padding that will also work for custom form field controls. Since we still use padding alignment, we can unset the MDC custom baseline styles. These currently have no effect, but will cause the form-field to always have a minimum height that needs extra treatment for the density levels.
1 parent cc9793f commit f2d2c19

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/material-experimental/mdc-form-field/_mdc-text-field-structure-overrides.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,14 @@
126126
.mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch {
127127
padding-top: 0;
128128
}
129+
130+
// Unset the baseline adjustment styles that are applied to the `.mdc-text-field` before
131+
// pseudo element. We control the vertical alignment of form field controls using infix
132+
// spacing since we support custom form-field controls. Those don't necessarily have an
133+
// explicit height that matches with the Material Design specification. If the height isn't
134+
// explicitly set to a specific value by MDC, the control will not align correctly vertically.
135+
// e.g. No vertical spacing to the bottom-line if the control is too large.
136+
.mat-mdc-text-field-wrapper::before {
137+
content: none;
138+
}
129139
}

0 commit comments

Comments
 (0)