Reputation: 210
Angular material form field label overlaps with entered text, Also multiple cosmetic issues? Long labels with fields have issue with responsiveness. Check stackblitz link: https://stackblitz.com/edit/angular-ar2ulq
Any Solution? Condition : Complete label should be visible, it should not get shrink.
Upvotes: 1
Views: 4517
Reputation: 125
You can adjust the label white-space property:
<mat-form-field class="field-label-ellipsis" appearance="outline" floatLabel="always">
<mat-label>
Legacy form field long Long long Long long Long long Long long Long lon
Long long Long long Long long Long label
</mat-label>
<input matInput placeholder="Placeholder" />
<mat-hint>Hint</mat-hint>
</mat-form-field>
And the CSS:
.field-label-ellipsis mat-label {
white-space: nowrap;
}
Upvotes: 1