Skip to content

block-scroll-strategy: some styles will cause not working as expected #15051

Open
@hsuanxyz

Description

@hsuanxyz

What is the expected behavior?

documentElement fixed the position and block scrolling.

What is the current behavior?

documentElement the position offset.

What are the steps to reproduce?

cdk-scroll

html, body {
  width: 100%;
  height: 100%;
}

body { 
  overflow-x: hidden;
}

StackBlitz: https://stackblitz.com/edit/angular-cgmaeh

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

@angular/cdk 7.3

Is there anything else we should know?

https://github.com/angular/material2/blob/e039d6388fd18726c18ba1252b2118b8dfe87dfb/src/cdk/overlay/_overlay.scss#L128~L140

  .cdk-global-scrollblock {
  ...
+  body {
+    overflow-x: unset;
+  }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: cdk/overlay

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions