bug(Mat-Form-Field): Angular Material form field Long label overlapping with input text
Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Angular material form field label overlaps with user entered text, Also long labels with fields have issue with responsiveness.
Reproduction
Check stackblitz link: https://stackblitz.com/edit/angular-ar2ulq
Expected Behavior
Complete label should be visible, it should not get shrink.
Actual Behavior
Label is getting shrink or not appearing on the screen
Environment
- Angular: 9.2.4
- CDK/Material: 9.2.4
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
This custom style is breaking it:
.mat-form-field-label {
white-space: normal !important;
}
Closing the issue since generally we don't encourage overrides like this.
Even if we remove the override what would be other option?
I don't follow. Removing the override fixes the issue because the text doesn't wrap anymore.
Removing override fixes the overlap issue, but it doesn't fix the label issue as well. Complete label should appear on screen. If not, How end user will read the complete field label? (if it long to appear on screen). check stackblitz: https://stackblitz.com/edit/angular-ar2ulq
The Material Design spec doesn't recommend splitting it across multiple lines or truncating, but rather keeping the label short to begin with. The truncation is a fallback in case a really tall label does come in.

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.