angular / angular/components

bug(mat-button, mat-icon): mat-icon inside of mat-button are truncated

Aperta
#30,763 5 commenti 3 reazioni 0 assegnatari Vedi su GitHub
area: material/button 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

Not sure which

### Description

Using Angular 19 with angular material, if I put a `mat-icon` element inside of a `mat-button`, the icon is not completely visible. It is truncated a little at its top and bottom. See reproduction StackBlitz below.

### Reproduction

Forked the "Button Angular Component" example to display the problem.

Editor: https://stackblitz.com/edit/3zsvfedr?file=src%2Fexample%2Fbutton-overview-example.html
Application: https://3zsvfedr.stackblitz.io

See the second button in the "Basic" "Raised" "Stroke" and "Flat" table rows.

### Expected Behavior

I would expect the icon to be fully visible, not truncated. In case of the `add_circle` icon, I would expect its shape to be perfectly round.

### Actual Behavior

The top and bottom of the icon are truncated (cropped) which makes it painfully _not round_.

![Image](https://github.com/user-attachments/assets/7b00a4b4-e485-43b1-8786-9d8315c6fabd)

### Environment

- Angular: 19
- CDK/Material: 19.2.7
- Browser(s): Edge, Chrome and Firefox
- Operating System: Windows

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione collegata in StackBlitz e confronta i secondi pulsanti degli esempi Basic, Raised, Stroke e Flat. Traccia il rendering e lo styling di Angular Material mat-button e mat-icon coinvolti nel ritaglio. Il lavoro è completato quando l'icona è completamente visibile e l'icona add_circle appare rotonda nei browser segnalati.

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
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.