Skip to content

Commit ad06d7d

Browse files
authored
fix(material-experimental/mdc-form-field): color inputs not working (#23095)
Fixes that the `color` type inputs didn't work due to a style override we had on top of MDC.
1 parent 0816f08 commit ad06d7d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@
2424
// not work for us since we support arbitrary form field controls which don't necessarily
2525
// use an `input` element. We organize the vertical spacing on the infix container.
2626
.mdc-text-field--no-label:not(.mdc-text-field--textarea)
27-
.mat-mdc-form-field-control.mdc-text-field__input,
27+
.mat-mdc-form-field-control.mdc-text-field__input,
2828
.mat-mdc-text-field-wrapper .mat-mdc-form-field-control {
2929
height: auto;
3030
}
3131

32+
// Color inputs are a special case, because setting their height to
33+
// `auto` will collapse them. The height value is an arbitrary number
34+
// which was extracted from the user agent styles of Chrome and Firefox.
35+
.mat-mdc-text-field-wrapper .mat-mdc-form-field-control.mdc-text-field__input[type='color'] {
36+
height: 23px;
37+
}
38+
3239
// Root element of the mdc-text-field. As explained in the height overwrites above, MDC
3340
// sets a default height on the text-field root element. This is not desired since we
3441
// want the element to be able to expand as needed.

0 commit comments

Comments
 (0)