Skip to content

bug(Cdk virtual scroll): Cdk virtual scroll not working properly with compareWith #19584

@ilapavuluri

Description

@ilapavuluri

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue

Steps to reproduce:

  1. I found a serious problem with *cdkVirtualFor, this improved the performance but breaking my functionality, in my selection-list, I will select options by checking the check-box like in the below image, if I select a option and scroll down and scroll up again I am losing the selection.

image

image

{{cio.label}}

compareFunction = (option1:string, option2:string)=> option1===option2;

Expected Behavior

What behavior were you expecting to see?

Actual Behavior

What behavior did you actually see?

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions