angular / angular/components

virtual-scroll doesn't work well with animate.leave

Đang mở
#32,943 4 bình luận 2 reaction 0 người được giao Xem trên GitHub
area: cdk/scrolling gemini-triaged
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ả

### Which @angular/* package(s) are the source of the bug?

virtual-scroll

### Is this a regression?

No

### Description

1. With a default `cdkVirtualForTemplateCacheSize` set to `20` virtuall-scroll keeps `leave` class on a template and uses this template for next row generation; in that case, new rows turn out to be `hidden`.
2. With a `cdkVirtualForTemplateCacheSize` set to `0` to disable cache virtuall-scroll do not remove rows while slow/normal scroll speed, and only removes on a high speed scrolling.

### Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-n4xn2i7p?file=src%2Fmain.ts

### Please provide the exception or error you saw

```true

```

### Please provide the environment you discovered this bug in (run `ng version`)

```true
Angular CLI : 21.2.2
Angular : 21.2.4
Node.js : 22.22.0
Package Manager : npm 10.8.2
Operating System : linux x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations │ 21.2.4 │ ^21.2.4 │
│ @angular/build │ 21.2.2 │ ^21.2.2 │
│ @angular/cli │ 21.2.2 │ ^21.2.2 │
│ @angular/common │ 21.2.4 │ ^21.2.4 │
│ @angular/compiler │ 21.2.4 │ ^21.2.4 │
│ @angular/compiler-cli │ 21.2.4 │ ^21.2.4 │
│ @angular/core │ 21.2.4 │ ^21.2.4 │
│ @angular/forms │ 21.2.4 │ ^21.2.4 │
│ @angular/material │ 21.2.2 │ ^21.2.2 │
│ @angular/platform-browser │ 21.2.4 │ ^21.2.4 │
│ @angular/router │ 21.2.4 │ ^21.2.4 │
│ rxjs │ 7.8.2 │ ^7.8.1 │
│ typescript │ 5.9.3 │ ^5.9.3 │
│ zone.js │ 0.16.0 │ ^0.16.0 │
└───────────────────────────┴───────────────────┴───────────────────┘
```

### Anything else?

_No response_

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 trong src/main.ts và tái hiện cả hai cài đặt cdkVirtualForTemplateCacheSize trong khi cuộn. Theo dõi điểm vào của virtual-scroll và hành vi của animation; được xem là hoàn tất khi các hàng được lưu trong bộ nhớ đệm không còn giữ lớp leave hoặc bị ẩn, và các hàng không được lưu trong bộ nhớ đệm được xóa trong quá trình cuộn chậm và bình thường cũng như khi cuộn nhanh.

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ó
4/5
Thời gian dự kiến
3-5 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.