components
components copied to clipboard
bug(cdk/overlay): BlockScrollStrategy is not working properly when overlay is called inside OnInit
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: 101vhapplied asapp-rootstyles, block is working fine (stackblitz) -
height: 101vhis applied as.rootclass with@HostBindingcall - 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