Skip to content

Commit f65d5b5

Browse files
authored
fix(material-experimental/mdc-form-field): set explicit text-align (#22353)
Sets an explicit `text-align` on the MDC form field so that it isn't affected by the surrounding `text-align`. The issue can be seen by placing an MDC-based `mat-select` in a container with `text-align: cetner`. We have something similar in the existing form field already.
1 parent 10ecfa0 commit f65d5b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
flex-direction: column;
3838
// This allows the form-field to shrink down when used inside flex or grid layouts.
3939
min-width: 0;
40+
// To avoid problems with text-align.
41+
text-align: left;
42+
43+
[dir='rtl'] & {
44+
text-align: right;
45+
}
4046
}
4147

4248
// Container that contains the prefixes, infix and suffixes. These elements should

0 commit comments

Comments
 (0)