angular / angular/components

bug(mat-list): Bad symmetry on text when line-break in code

オープン
#26,657 コメント 0 件 リアクション 5 件 担当者 0 名 GitHub で見る
area: material/list 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

The text in both matListItemTitle and matListItemLine creates a whitespace at the start and end of the text when the code is broken over multiple lines. This breaks the symmetry of the list items as seen in this example on the docs page
![image](https://user-images.githubusercontent.com/3032384/220096686-6c734818-a024-42af-8536-fee6da3ccad8.png)

### Reproduction

Stackblitz of the issue already showing in the docs page:
https://stackblitz.com/run?file=src%2Fapp%2Flist-variants-example.ts

Works:
`Text`

Creates extra spacing:
```

Text

```

### Expected Behavior

Expect the result not to have white spaces when rendered, or to ignore the white spaces. As it worked in v14.

### Actual Behavior

Gets an extra white space when the code has line break inside tag. Breaks symmetry

### Environment

- Angular: latest v15
- CDK/Material: latest v15
- Browser(s): All
- Operating System (e.g. Windows, macOS, Ubuntu): All

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

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

調査の方向性

StackBlitz の再現から始め、特に src/app/list-variants-example.ts を確認し、インラインおよび複数行の span コンテンツを用いた、レンダリングされた matListItemTitle と matListItemLine のマークアップを比較します。再現から関連する Angular Material のリスト実装をたどり、複数行のマークアップが先頭または末尾の空白なしでレンダリングされ、リスト項目の対称性が維持されることを確認します。

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

評価

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

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

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