components icon indicating copy to clipboard operation
components copied to clipboard

bug(cdk/overlay): BlockScrollStrategy is not working properly when overlay is called inside OnInit

Open thekhegay opened this issue 1 year ago • 0 comments

Description

I didn't find any description in the documentation, but when Overlay creation called in OnInit, BlockScrollStrategy is not blocking scroll.

I noticed another behavior:

  • height: 101vh applied as app-root styles, block is working fine (stackblitz)
  • height: 101vh is applied as .root class with @HostBinding call - block is not working (stackblitz)

I think related: https://github.com/angular/components/issues/19020, https://github.com/angular/components/issues/22217

Reproduction

Everything works fine when called inside AfterViewInit: https://stackblitz.com/edit/stackblitz-starters-sp8ikj?file=src%2Fmain.ts

Environment

  • Angular: 17.3.5
  • CDK/Material: 17.3.5
  • Browser(s): any
  • Operating System (e.g. Windows, macOS, Ubuntu): any

thekhegay avatar Apr 21 '24 20:04 thekhegay