angular / angular/components

bug(mat-error,mat-hint): mat-error and mat-hint display leading spaces

オープン
#27,722 コメント 3 件 リアクション 3 件 担当者 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

14.2.7

### Description

In versions pre mdc migration mat-hint and mat-error do NOT display leading spaces.
In versions post mdc migration mat-hint and mat-error do display leading spaces.

This behavior causes multi-line hints and errors to not align properly.

Of course this just a small thing an can be fixed by formatting the html differently but it is technically an undocumented breaking change. So i need to know if this is intended behavior and i have to fix it in my code or if it will be fixed in angular material.

Apparently there was already an issue for that #26430 but it was closed for not being reproducable but my StackBlitz Links show that it is still the case.

### Reproduction

Working StackBlitz link (14.2.7): https://stackblitz.com/edit/xxdwty?file=src%2Fapp%2Fform-field-appearance-example.html
Error StackBlitz link (16.2.1): https://stackblitz.com/edit/qopght?file=src%2Fexample%2Fform-field-appearance-example.html,src%2Findex.html

### Expected Behavior

Leading spaces are not displayed.

### Actual Behavior

Leading spaces are displayed.

### Environment

- Angular: 16
- CDK/Material: 16.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

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

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

調査の方向性

リンクされた StackBlitz の例から始め、Angular Material 14.2.7 の src/app/form-field-appearance-example.html と、16.2.1 の src/example/form-field-appearance-example.html および src/index.html を比較します。mat-hint と mat-error における先頭スペースの挙動を確認し、そのうえで複数行の配置を崩すことなく期待される挙動が復元されることを検証します。

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

評価

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

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

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