angular / angular/components

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

Đang mở
#30,763 5 bình luận 3 reaction 0 người được giao Xem trên GitHub
area: material/button P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết và so sánh các nút thứ hai trong các ví dụ Basic, Raised, Stroke và Flat. Truy vết quá trình kết xuất và tạo kiểu của Angular Material mat-button và mat-icon liên quan đến việc bị cắt. Hoàn tất khi biểu tượng hiển thị đầy đủ và biểu tượng add_circle xuất hiện hình tròn trên các trình duyệt đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.