angular / angular/components

bug(material/autocomplete): Intermittent Scrolling Issue with mat-autocomplete on Mobile Devices

オープン
#28,581 コメント 3 件 リアクション 4 件 担当者 0 名 GitHub で見る
area: material/autocomplete P3
主要言語
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

We are experiencing an intermittent but recurring issue with the mat-autocomplete component when accessed via mobile devices. Specifically, when users attempt to scroll through the options presented in the autocomplete dropdown, the scroll action unexpectedly affects the underlying webpage instead of the dropdown list. This behavior disrupts the user's ability to select an option from the autocomplete list and significantly impacts the usability of the component. The issue has been consistently observed across a variety of devices and web browsers, indicating a broader compatibility or event handling problem within the component.

Video Demonstration of the Issue:
https://javamaniac.github.io/angular-autocomplete-example/screen-20240212-143204.mp4

### Reproduction

StackBlitz link: https://stackblitz.com/~/github.com/javamaniac/angular-autocomplete-example

The issue with mat-autocomplete scrolling is intermittent and does not have a consistent reproduction sequence. However, it generally involves interactions with the autocomplete component on a mobile device. Below are steps that have sometimes led to the issue, though it may require repeating certain actions or experimenting with the sequence to observe the problem.

Potential Reproduction Sequences:

Basic Interaction:
1. Open the autocomplete dropdown.
2. Attempt to scroll through the options.

Extended Interaction:
1. Open the autocomplete dropdown.
2. Select any option from the list.
3. Clear the selected option (erase the choice).
4. Attempt to scroll through the options again.

External Interaction:
1. Open the autocomplete dropdown.
2. Click outside the dropdown to close it.
3. Re-open the dropdown.
4. Attempt to scroll through the options.

Note: The issue may not manifest on the first attempt and could require varying the sequence of actions, such as selecting and clearing choices multiple times or opening and closing the dropdown before scrolling attempts are made. The problem appears to be more likely to occur after interacting with the dropdown in some way (selecting options, erasing choices, or clicking outside the dropdown) before attempting to scroll through the options again.

### Expected Behavior

Dragging (scrolling) within the mat-autocomplete dropdown should scroll through the autocomplete options.

### Actual Behavior

Attempting to scroll through the autocomplete options results in the page itself scrolling.

### Environment

- Angular: 16, 17 (issue likely affects older versions as well)
- CDK/Material: 16, 17
- Browser(s): Chrome, Edge, Safari
- Operating System (e.g. Windows, macOS, Ubuntu): Android, iOS

Devices tested:
- Google Pixel 6 (Chrome, Edge)
- iPhone SE (Chrome, Safari)

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

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

調査の方向性

リンクされた StackBlitz の再現手順と、issue に記載された mat-autocomplete の操作から始め、一覧にあるモバイルブラウザーとデバイスでテストします。修正が完了するのは、開いたドロップダウン内でスクロールまたはドラッグしたときに、背後のページではなくそのオプションが一貫して移動し、選択、クリア、閉じる、再度開く操作の後も同じ動作になる場合です。

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

評価

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

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

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