Skip to content

bug(scrolling): Opening dialog in window virtual scroll break scrolling #26240

Open
@MikaStark

Description

@MikaStark

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

cdk-virtual-scroll-viewport[scrollWindow] is empty when opening a mat-dialog if the window have been scrolled.

When the dialog is closed, everything returns to normal but the scroll is restored to top 0.

Reproduction

Steps to reproduce:

  1. Go to https://stackblitz.com/edit/angular-psylrc
  2. Click on "open dialog" button of the 100th line

Expected Behavior

The virtual scroll should not be influenced by dialog

Actual Behavior

Virtual scroll container become empty and when the dialog is closed the items come back but the scroll is restored to 0

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/scrolling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions