angular / angular/components

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

オープン
#26,199 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
area: material/autocomplete P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、リンクされている angular-scroll-block.stackblitz.io の例で動作を再現し、動作する document-scroll の例と比較します。MatAutocomplete と BlockScrollStrategy のエントリポイントを確認し、autocomplete が開いている間は cdkScrollable コンテナのスクロールがブロックされることを、他のスクロール戦略を壊さずに検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。