bug(CDK/SCROLLING): <object> element in *cdkVirtualFor is glitching when using "templateCacheSize: 0"
Chưa có ai nhận issue này.
- 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
When using No cache strategy (templateCacheSize: 0) for *cdkVirtualFor with element (as image), elements of list glitch while scrolling. Seems like cdkVirtualFor incorrectly init/reinit or reuse instances of listed elements.
When using tag instead of no bug detected.
Reproduction
StackBlitz link: https://stackblitz.com/edit/uyv2wg?file=src%2Fexample%2Fcdk-virtual-scroll-template-cache-example.html
Steps to reproduce:
- Create list of 100 elements, use with image link data.
- Scroll
- Angular: 17.0.0-rc.0 (and 15)
- CDK/Material: 16.2.10
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOs
Expected Behavior
Smooth scrolling, correct reusing/reinit of list elements, no content replacing.
Actual Behavior
Scrolling is not smooth (end sometimes end / start of list is unreachable), elements in list are replaced by content of sibling.
Environment
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với bản tái hiện StackBlitz được liên kết và xác minh hành vi trong Chrome bằng cách sử dụng cdkVirtualFor với templateCacheSize: 0 và object image elements. Đọc phần triển khai cuộn ảo của CDK liên quan đến việc tái sử dụng template và so sánh với trường hợp img. Hoàn tất khi thao tác cuộn mượt mà, có thể tiếp cận tất cả các mục trong danh sách và không có nội dung nào bị thay thế bởi một phần tử anh em.
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
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100