angular / angular/components

bug(mat-button-toggle): mat-button-toggle is 2px too tall

Đang mở
#30,405 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area: material/button-toggle P4
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?

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

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

_No response_

### Description

A `mat-button-toggle` is 2px taller than a `mat-stroked-button` despite both `--mat-standard-button-toggle-height` and `--mdc-outlined-button-container-height` both defaulting to 40px.

![Image](https://github.com/user-attachments/assets/fa897af5-2db7-46d0-8e65-c4531a46404b)
(this screenshot is at 2x zoom; each grid square is 2px)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-bqkpddq3?file=src%2Fmain.ts

### Expected Behavior

`mat-stroked-button` and `mat-button-toggle` have the same height

### Actual Behavior

`mat-button-toggle` is 2px taller than `mat-stroked-button`

### Environment

```
> ng version

_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/

Angular CLI: 18.2.8
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 18.2.8
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, material, platform-browser, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1802.9
@angular-devkit/build-angular 18.2.9
@angular-devkit/core 18.2.9
@angular-devkit/schematics 18.2.8
@schematics/angular 18.2.8
rxjs 7.8.1
typescript 5.5.4
zone.js 0.14.10
```

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 trong src/main.ts và so sánh mat-button-toggle với mat-stroked-button ở các phiên bản Angular được báo cáo. Theo dõi chiều cao được render của hai component và xác minh bản sửa bằng cách xác nhận rằng cả hai control đều có cùng chiều cao như trong bản tái hiện.

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.