File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed
src/material-experimental/mdc-form-field Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 114114 .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-text-field__input {
115115 display : inline-block ;
116116 }
117+
118+ // By default, MDC aligns the label using percentage. This will be overwritten based
119+ // on whether a textarea is used. This is not possible in our implementation of the
120+ // form-field because we do not know what type of form-field control is set up. Hence
121+ // we always use a fixed position for the label. This does not have any implications.
122+ .mat-mdc-text-field-wrapper .mdc-floating-label {
123+ top : $mat-form-field-baseline ;
124+ }
125+
126+ // As mentioned in the override before, MDC aligns the label using percentage. This means that
127+ // MDC tries to offset the label when the parent element changes in the notched-outline. For
128+ // example, the outline stroke width changes on focus. Since we updated the label to use a fixed
129+ // position, we don't need the vertical offsetting (that will shift the label incorrectly now).
130+ // Note: Increased specificity needed here since MDC overwrites the padding on `:focus`.
131+ .mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field .mdc-notched-outline__notch {
132+ padding-top : 0 ;
133+ }
117134}
Original file line number Diff line number Diff line change 3030 // This brings it in line with other browsers.
3131 overflow : auto ;
3232 }
33-
34- // By default, MDC aligns the label using percentage. This will be overwritten based
35- // on whether a textarea is used. This is not possible in our implementation of the
36- // form-field because we do not know what type of form-field control is set up. Hence
37- // we always use a fixed position for the label. This does not have any implications.
38- .mat-mdc-text-field-wrapper .mdc-floating-label {
39- top : $mat-form-field-baseline ;
40- }
4133}
You can’t perform that action at this time.
0 commit comments