bug(virtual-scroll): scrollToIndex does not work for multiple viewports scrolling over the same element
- 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
If you have multiple viewports beneath eachother the function 'scrollToIndex' does not work if you want to scroll to an element in one of the bottom lists. It scrolls to a wrong position.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-dch1m4?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.ts,src%2Fapp%2Fexample-component.css
Steps to reproduce:
1. Click the button 'Scroll to viewport 3 and index 7'
2. It scrolls to the wrong position.
### Expected Behavior
It should scroll to the correct position.
### Actual Behavior
It should scroll to the wrong position.
### Environment
- Angular: 16.2.1
- CDK/Material: 16.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Stackblitz
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/app/example-component.html và src/app/example-component.ts, rồi thực hiện các bước để cuộn đến viewport 3 và index 7. Theo dõi hành vi virtual-scroll đối với nhiều viewport dùng chung một phần tử và so sánh vị trí nhận được với mục tiêu dự kiến. Hoàn tất khi nút cuộn đến đúng mục trong viewport bên dưới.
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