angular / angular/components

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

Aperta
#23,037 1 commento 4 reazioni 0 assegnatari Vedi su GitHub
area: cdk/overlay needs investigation P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata e dal punto di ingresso del posizionamento cdkConnectedOverlay di CDK. Riproduci il problema su Chrome Android o Safari iOS aprendo l’overlay, scorrendo per nascondere la barra degli indirizzi e aprendolo di nuovo. Il lavoro è completato quando l’overlay connesso rimane posizionato correttamente dopo le modifiche al viewport mobile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.