angular / angular/components

bug(CDK Overlay): cdkConnectedOverlay ConnectedPosition not correctly calculated after scrolling on mobile browser

オープン
#23,037 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る
area: cdk/overlay needs investigation P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

The ConnectedPositions for a cdkConnectedOverlay are not correctly calcullated when browsing and scrolling on a mobile browser. The mobile devices are hiding the address bar when you scroll down. This results in a change of the viewport sizes. If you open a cdkConnected overlay after scrolling it's position is at the wrong location.

#### Reproduction

https://stackblitz.com/edit/components-issue-mbxfr2

Steps to reproduce:
1. Create a component with cdkConnectedOverlay
2. Add it to your application
3. Browse to your angular app on a mobile device a
4. Open the overlay -> this should be correct positioned
5. Scroll down (the browser hides the address bar)
6. Overlay position is on wrong location

#### Expected Behavior

The connected overlay should be on the correct position after scrolling on a mobile device

#### Actual Behavior

The position of the overlay is calculated wrong and displayd at the wrong position.

The position of the overlay with the address bar (as expected)
![Screenshot_20210622-150122_Chrome](https://user-images.githubusercontent.com/78798355/122936977-e4e65e80-d371-11eb-81db-b9dcfa474cb4.jpg)

The position of the overlay without the address bar, after scrolling (not as expected)
![Screenshot_20210622-150129_Chrome](https://user-images.githubusercontent.com/78798355/122936983-e57ef500-d371-11eb-958e-ea24497869b5.jpg)

#### Environment
- Angular: 12
- CDK/Material: 12
- Browser(s): Chrome Android, Safari IOS
- Operating System: IOS, Android

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

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

調査の方向性

リンクされている StackBlitz の再現手順と、CDK の cdkConnectedOverlay の配置エントリーポイントから始めます。Chrome Android または Safari iOS で overlay を開き、アドレスバーを隠すためにスクロールしてから、もう一度開いて問題を再現します。モバイル viewport の変更後も connected overlay が正しく配置されたままになれば完了です。

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

評価

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

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

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