Skip to content

bug(cdk/overlay): scroll blocking overlay persists when documentElement shrinks to the point it is not needed #30943

Open
@mmalerba

Description

@mmalerba

Description

This came up for an app that had a button to launch a full screen dialog. When you click the button it essentially hides the main app and launches the dialog. However, at the time the dialog launches, the content is still showing so it calculates the height based on documentElement here (https://github.com/angular/components/blob/main/src/cdk/overlay/scroll/block-scroll-strategy.ts#L111) and determines the scroll blocking class is needed. The main content then disappears making the blocking class unnecessary, but it never updates after the initial calculation. This results in a disabled scrollbar being shown in the app.

As a workaround, apps in this situation should ensure that they remove content they want to hide & wait for that change to be rendered in the DOM before launching the dialog.

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