bug(mat-form-field): when using appearance="outline", input fields increases in height.
Is this a regression?
- [X] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When using mat-form-field with appearance="outline", text input field increases in height after entering a text Reproduces on mobile devices with iOS 17+
Reproduction
Steps to reproduce:
- Open Safari 17 on a mobile device (it is the default browser for iOS 17)
- Open Angular Material Page at https://material.angular.io/components/form-field/overview
- Find Outline form field
- Enter any text. Probably need to clear the field and enter the text again.
Expected Behavior
The height of the field should be the same as the field without text
Actual Behavior
The field height is different compared to the field without text
Environment
- Angular: 15-17
- CDK/Material: 15-17
- Browser(s): mobile Safari 17
- Operating System iOS 17.1.2
I can reproduce it as well, although it's weird that it only happens on a device and not the simulator.
I recently updated to iOS 17.3 and I can't reproduce the issue anymore. Can anybody else confirm if it's gone on their end?
I recently updated to iOS 17.3 and I can't reproduce the issue anymore. Can anybody else confirm if it's gone on their end?
I can reproduce it on iOS 17.4
I was able to prevent this behavior by adding the following CSS:
.mdc-text-field--outlined .mat-mdc-form-field-infix,
.mdc-text-field--no-label .mat-mdc-form-field-infix {
padding-bottom: unset !important;
}
I searched the repo for that class and it looks like it might be coming from https://github.com/angular/components/blob/8fab89229d3aad9109c5a22244f9f35ae3fc675f/src/material/form-field/_mdc-text-field-density-overrides.scss#L30
I was able to prevent this behavior by adding the following CSS:
.mdc-text-field--outlined .mat-mdc-form-field-infix, .mdc-text-field--no-label .mat-mdc-form-field-infix { padding-bottom: unset !important; }I searched the repo for that class and it looks like it might be coming from
https://github.com/angular/components/blob/8fab89229d3aad9109c5a22244f9f35ae3fc675f/src/material/form-field/_mdc-text-field-density-overrides.scss#L30
Works for me as a tempotrary solution. Thanks. iOS 17.4