angular / angular/components

feat(cdk/scrolling): Scroll functions silently fail if the viewport is not yet fully initialized

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

#### Feature Description

`cdk-virtual-scroll-viewport`'s `scrollTo...` functions (like `scrollToIndex`) silently fail when the viewport is not yet initialized. Technically the functions are doing nothing wrong from a code standpoint, but since the component is not yet fully initialized, it is empty, so trying to scroll will do nothing meaningful. Sending back an error (or at least logging a warning to the console) if an empty viewport is scrolled would be helpful so that developers know that something went wrong.

This would be mitigated if we had an async option that managed the timing of scroll commands. See [this feature request](https://github.com/angular/components/issues/23715).

#### Use Case

This would improve every use case of the virtual scroller.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ các entry point scrollTo... của cdk-virtual-scroll-viewport và kiểm tra cách biểu diễn việc khởi tạo cũng như một viewport trống. Xác nhận với các maintainer xem hành vi sau khi hoàn tất nên là một lỗi hay một cảnh báo trên console, sau đó bổ sung coverage tập trung cho thấy việc cuộn trước khi khởi tạo không còn thất bại một cách im lặng.

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ó
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.