angular / angular/components

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

Aperta
#26,528 1 commento 3 reazioni 0 assegnatari Vedi su GitHub
area: material/list P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata e analizza il comportamento dei badge di mat-list e mat-nav-list con l’implementazione MDC di Angular Material. Riproduci il badge troncato, quindi verifica che il badge sia completamente visibile senza richiedere un workaround.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.