Skip to content

Vertical positioning of flexible connected overlay on mobile #13614

Description

@oschlegel

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/overlay

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions