bug(mat-button, mat-icon): mat-icon inside of mat-button are truncated
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
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
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.
Environment
- Angular: 19
- CDK/Material: 19.2.7
- Browser(s): Edge, Chrome and Firefox
- Operating System: Windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and compare the second buttons in the Basic, Raised, Stroke, and Flat examples. Trace the Angular Material mat-button and mat-icon rendering and styling involved in the clipping. Done means the icon is fully visible and the add_circle icon appears round across the reported browsers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100