angular / angular/components

bug(option): mat-options with long text lack of gap since v15

Đang mở
#26,701 1 bình luận 4 reaction 0 người được giao Xem trên GitHub
area: material/select P3 regression
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

14

### Description

Before v15, `mat-option`s with long text were truncated so their height was always 48px and naturally, a gap was there to well separate each option.

Now the text is no more truncated but a min-height of 48px is applied. If the text of a `mat-option` take only one line the gap remains and there is no problem. But with 2 lines of more, the gap is no more and reading becomes more difficult

### Reproduction

https://stackblitz.com/edit/angular-hjwez5?file=src/styles.scss

### Expected Behavior

![image](https://user-images.githubusercontent.com/23034761/221603790-430f1dbb-2142-409d-b93f-07d719ef8216.png)

```css
.mat-mdc-option {
padding-top: 12px;
padding-bottom: 12px;
box-sizing: border-box;
}
```

### Actual Behavior

![image](https://user-images.githubusercontent.com/23034761/221603654-56faf2c9-17e7-4fda-9af6-b95369301b1b.png)

### Environment

- Angular: 15.2.0
- CDK/Material: 15.2.0
- Browser(s): All
- Operating System (e.g. Windows, macOS, Ubuntu): All

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, đặc biệt là src/styles.scss, và kiểm tra phần định kiểu mat-option cho văn bản nhiều dòng. Công việc được xem là hoàn tất khi khôi phục được khoảng cách dọc có thể nhìn thấy giữa các tùy chọn có một hoặc nhiều dòng, đồng thời vẫn giữ khoảng cách 48px như mong đợi cho các tùy chọn một dòng.

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, css, typescript
Lĩnh vực
design, frontend
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả 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.