File tree Expand file tree Collapse file tree 3 files changed +520
-525
lines changed
src/material-experimental/mdc-form-field Expand file tree Collapse file tree 3 files changed +520
-525
lines changed Original file line number Diff line number Diff line change 5656 "@types/youtube" : " ^0.0.38" ,
5757 "@webcomponents/custom-elements" : " ^1.1.0" ,
5858 "core-js" : " ^2.6.9" ,
59- "material-components-web" : " 6.0.0-canary.17b9699c4 .0" ,
59+ "material-components-web" : " 6.0.0-canary.d5808057f .0" ,
6060 "rxjs" : " ^6.5.3" ,
6161 "systemjs" : " 0.19.43" ,
6262 "tslib" : " ^1.10.0" ,
Original file line number Diff line number Diff line change 2727 border : none ;
2828 }
2929
30- // Reset the padding that MDC sets on native input elements. We cannot rely on this
31- // spacing as we support arbitrary form-field controls which aren't necessarily matching
32- // the "mdc-text-field__input" class. Note: We need the first selector to overwrite the
33- // default no-label MDC padding styles which are set with a very high specificity.
30+ // Reset the height that MDC sets on native input elements. We cannot rely on their
31+ // fixed height as we handle vertical spacing differently. MDC sets a fixed height for
32+ // inputs and modifies the baseline so that the textfield matches the spec. This does
33+ // not work for us since we support arbitrary form field controls which don't necessarily
34+ // use an `input` element. We organize the vertical spacing on the infix container.
3435 .mdc-text-field--no-label :not (.mdc-text-field--textarea )
3536 .mat-mdc-input-element.mdc-text-field__input ,
3637 .mat-mdc-text-field-wrapper .mat-mdc-input-element {
37- padding : 0 ;
38+ height : auto ;
3839 }
3940
4041 // MDC adds vertical spacing to inputs. We removed this spacing and intend to add it
7778 opacity : 1 ;
7879 }
7980
80- // We removed the horizontal inset on input elements, but need to re-add the spacing to
81- // the actual form-field flex container that contains the prefixes, suffixes and infix.
82- .mat-mdc-text-field-wrapper .mat-mdc-form-field-flex {
83- padding : 0 $mdc-text-field-input-padding ;
84- }
85-
8681 // Since we moved the horizontal spacing from the input to the form-field flex container
8782 // and the MDC floating label tries to account for the horizontal spacing, we need to reset
8883 // the shifting since there is no padding the label needs to account for. Note that we do not
You can’t perform that action at this time.
0 commit comments