angular / angular/components

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

オープン
#26,430 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る
area: material/form-field P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### 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

v14

### Description

When I use mat-error like this:
``
` My Error Message`
``
the resulting string for "My Error Message" has spaces at the beginning and end of it: " My Error Message ".

When I do this:
`My Error Message`
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

- CDK/Material: 15.0.4
- Browser(s): Firefox/Chrome
- Operating System Windows

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず Angular Material の複数行 mat-error の例を再現し、メッセージの内容がどのようにレンダリングされるかを追跡します。複数行の mat-error テキストに先頭または末尾のスペースがなく、単一行の場合も引き続き正しく表示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。