angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.33k stars 6.73k forks source link

bug(Form field): mat-error adds spaces to beginning and end when on several lines #26430

Open alexander-braun opened 1 year ago

alexander-braun commented 1 year ago

Is this a regression?

The previous version in which this bug was not present was

v14

Description

When I use mat-error like this: <mat-error *ngIf="VERY-LONG-CONDITION-THAT-CREATES-A-LINE-BREAK"> My Error Message </mat-error> the resulting string for "My Error Message" has spaces at the beginning and end of it: " My Error Message ".

When I do this: <mat-error *ngIf="CONDITION-IN-FUNCTION()">My Error Message<mat-error> the resulting string is displayed correctly.

Reproduction

Steps to reproduce:

  1. create a mat-error with a line-break and input some dummy text

Expected Behavior

There shouldn't be spaces inside the mat-error message when it is multi-line.

Actual Behavior

There are spaces inside the mat-error message when it is multi-line.

Environment

mrmokwa commented 1 year ago

could be related to #26164

amysorto commented 1 year ago

I am unable to reproduce this on Chrome and Firefox on windows on v16, so I'm closing this issue.

angular-automatic-lock-bot[bot] commented 1 year ago

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.

amysorto commented 6 months ago

Can be reproduced in this Stackblitz: https://stackblitz.com/edit/pfcx2g?file=src%2Fexample%2Finput-errors-example.html