angular / angular/components

bug(MatList): content projected mat-list-items do not apply mat-mdc-list-item-interactive

Đang mở
#27,608 4 bình luận 5 reaction 0 người được giao Xem trên GitHub
area: material/list 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

14.2.6

### Description

After updating to Angular v15 projecting `mat-list-items` into the `mat-nav-list` does no longer work as expected. The hover effect is not working as the class `mat-mdc-list-item-interactive` is not added.

```

google
angular

```

### Reproduction

StackBlitz link: https://stackblitz.com/edit/ng5v1w-bbsdvs?file=src%2Fexample%2Flist-overview-example.html
Steps to reproduce:
1. hover over not working items

### Expected Behavior

Content projected items should behave like they were added "directly".

### Actual Behavior

`Mat-list-items` do not get the `mat-mdc-list-item-interactive` class and therefore displayed as non-interactive.

### Environment

- Angular: 15.2.9
- CDK/Material: 15.2.9
- Browser(s): Firefox/Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): 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, đặc biệt là src/example/list-overview-example.html, và so sánh các mat-list-items được projection với các item được khai báo trực tiếp trong mat-nav-list. Tái hiện hành vi hover còn thiếu và lần theo đường đi của quá trình projection list-item; hoàn tất khi các item được projection nhận mat-mdc-list-item-interactive và hoạt động giống như các item được thêm trực tiếp.

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
35/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.