angular / angular/components

bug(mat-list): Badge within list item gets cut off

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

14

### Description

When placing a badge within a list item, the badge gets cut off:

image

This problem has already been [mentioned before](https://github.com/angular/components/issues/12384). However, back then it was easy to apply a workaround: set `overflow: visible` or add some padding to the parent element. With the mdc migration, this has become much harder because Angular Material adds wrapping elements to list items, of which we have little control. And in v14, it works just fine, even without workaround.

### Reproduction

Steps to reproduce:
1. Create a mat-(nav-)list
2. Add a badge on an element within the list

StackBlitz: https://stackblitz.com/edit/angular-hgiusr

### Expected Behavior

The badge should be fully visible

### Actual Behavior

The badge gets cut off

### Environment

- Angular: 15.1.0
- CDK/Material: 15.1.2
- Browser(s): Chrome 109.0.5414.87
- Operating System (e.g. Windows, macOS, Ubuntu): macOS Ventura

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

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

調査の方向性

リンクされた StackBlitz の再現環境から始め、Angular Material の MDC 実装における mat-list と mat-nav-list の badge の動作を調査します。切り取られた badge を再現し、その後、workaround を必要とせずに badge が完全に表示されることを確認します。

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

評価

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

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

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