angular / angular/components

bug(menu): Overflow behaviour does not match the documentation

Aperta
#26,807 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: material/menu P2
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

14

### Description

The behaviour when a menu button label has a long work (that can't be broken) is different in a newly created app than on the Angular Material demo page.

The `overflow: hidden` on `.mdc-list-item__primary-text` appears to be missing.

Material documentation page edited to make the label longer:

![image](https://user-images.githubusercontent.com/375694/225961116-ad806371-cd54-44f9-98be-536df1a50ba4.png)

App that copies the same code:

![image](https://user-images.githubusercontent.com/375694/225961374-2f96e965-ecb1-455b-aa7e-65f807775b6f.png)

### Reproduction

Steps to reproduce:
1. https://components-issue-5kgmsj.stackblitz.io (this is a copy of the code from the `basic menu` example but with a long label)
2. click to open the menu
3. the label overflows the content instead of getting an ellipsis

### Expected Behavior

Ellipsis

### Actual Behavior

Overflows

### Environment

- Angular: 15.2.3
- CDK/Material: 15.2.3
- Browser(s): all
- Operating System (e.g. Windows, macOS, Ubuntu): mac

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dall’implementazione del menu di Angular Material e dai relativi stili, cercando `.mdc-list-item__primary-text` e l’esempio di menu di base a cui si fa riferimento nel report. Riproduci l’etichetta lunga non divisibile nell’app StackBlitz collegata e confrontala con la demo della documentazione. Il lavoro è completato quando l’etichetta viene troncata con i puntini di sospensione invece di fuoriuscire.

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
Mezza giornata
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.