angular / angular/components

bug(MatAutocomplete): BlockScrollStrategy doesn't work with cdkScrollable

Đang mở
#26,199 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/autocomplete 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ả

### 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

Using `BlockScrollStrategy` on `MatAutocomplete` does not work unless the scroll container is the document itself.
I've added `cdkScrollable` to the scroll container, and `CloseScrollStrategy` and `RepositionScrollStrategy` do work, but not `BlockScrollStrategy`.

### Reproduction

1. https://angular-scroll-block.stackblitz.io
2. Use Ctrl+Space inside the input field and scroll the scroll-container.

Working example with the scroll in the document:
1. https://angular-scroll-block-works.stackblitz.io
2. 2. Use Ctrl+Space inside the input field and scroll the document.

### Expected Behavior

Scroll should be blocked when using `BlockScrollStrategy`

### Actual Behavior

Scroll is not blocked when using `BlockScrollStrategy`

### Environment

Angular CLI: 14.2.3

Node: 18.12.0 (Unsupported)
Package Manager: npm 8.19.2
OS: win32 x64

Angular: 14.2.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.3
@angular-devkit/build-angular 14.2.3
@angular-devkit/core 14.2.3
@angular-devkit/schematics 14.2.3
@angular/cli 14.2.3
@ngtools/webpack 14.2.3
@schematics/angular 14.2.3
ng-packagr 14.2.1
rxjs 7.5.6
typescript 4.8.3
webpack 5.74.0

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

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

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi trong ví dụ angular-scroll-block.stackblitz.io được liên kết và so sánh với ví dụ document-scroll đang hoạt động. Đọc các entry point của MatAutocomplete và BlockScrollStrategy, sau đó xác minh rằng việc cuộn vùng chứa cdkScrollable bị chặn khi autocomplete đang mở, mà không làm ảnh hưởng đến các chiến lược cuộn khác.

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
42/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.