angular / angular/components

Vertical positioning of flexible connected overlay on mobile

Open
#13,614 8 comments 3 reactions 0 assignees View on GitHub
area: cdk/overlay P4
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
Flexible connected overlays are positioned correct even if the user is scrolling

#### What is the current behavior?
Scrolling affects the vertical positioning of the overlay. The overlay is positioned to low.

#### What are the steps to reproduce?
Scroll down a page on a mobile device (not to the end of the page, but somewhere in the middle) and then open the flexible connected overlay. The overlay seems to be positioned to low.

Example desktop:
bildschirmfoto 2018-10-15 um 07 34 49

Example mobile:
bildschirmfoto 2018-10-15 um 07 34 25

Configuration of the overlay:
```
const positionStrategy = this.overlay
.position()
.flexibleConnectedTo(this.elementRef) // <-- elementRef is the icon element from the screenshot
.withPositions([
{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' },
{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' }
])
.withPush(false);
this.overlay.create({
positionStrategy,
scrollStrategy: this.overlay.scrollStrategies.reposition()
});
```

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
@angular/core: 6.1.0
@angular/material: 6.4.7
@angular/cdk: 7.0.0-rc.1
typescript: 2.7.2

Contributor guide

Open the contributing guide

Research direction

Start with the CDK overlay's flexibleConnectedTo position strategy and reposition scroll strategy shown in the report. Reproduce the issue on a mobile device after scrolling partway down the page, then trace the positioning behavior; done means the flexible connected overlay keeps the expected vertical position while scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.