CDK ScrollingModule: scrollToIndex() smooth behavior for all browsers
- 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ả
#### Bug, feature request, or proposal:
Feature request
#### What is the expected behavior?
Ability to scroll to index smoothly using `viewPort.scrollToIndex(currIndex, 'smooth')` on all browsers
#### What is the current behavior?
It works on _Chrome_ and _Firefox_ but it doesn't work on _Edge_ and _Safari_
#### What is the use-case or motivation for changing an existing behavior?
Currently, there is no way for the developer to get a cross-browser smooth scrolling with the CDK Virtual Scroll component
Even if the developer has to develop his own smooth scroll function, then he has to get the scroll offset of the target item, which is not possible with the current API
The only available function for measuring the scroll offset is `viewPort.measureScrollOffset('start')` which return the offset of the view, but there is no function to measure the scroll offset of a specific item
We either need `viewPort.measureIndexOffset(index)` function to develop it or a built-in cross-browser smooth scroll feature
In my case I am using the **ScrollingModule** to develop a carousel but the smooth scroll does not work on mobile browsers, Safari and Edge

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
CDK: **7.0.0-beta.1**
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra CDK ScrollingModule và API virtual-scroll của nó, đặc biệt là scrollToIndex() và measureScrollOffset(). So sánh hành vi smooth scrolling được báo cáo trong Chrome, Firefox, Edge và Safari. Được xem là hoàn tất khi smooth scrolling trên nhiều trình duyệt hoạt động thông qua scrollToIndex() hoặc API cung cấp scroll offset của index đích để có một giải pháp thay thế đáng tin cậy.
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
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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
- 25/100