Skip to content

CDK Virtual Scroll + Router Active Link changes active item when scrolling #18021

@alek-aleksandrov

Description

@alek-aleksandrov

Reproduction

https://stackblitz.com/github/empty-god/scroll-test

Steps to reproduce:

  1. Click on any item in the list, and scroll to get new items
  2. You should see the non-selected items highlighted, in no specific order

Expected Behavior

The list should continue scrolling with no further highlight changes without a new click.

Actual Behavior

The list seems to select a similarly placed item instead of referencing the correct variable in selection.

Environment

  • Angular: 8.2.13
  • CDK/Material: 8.2.3
  • Browser(s): Chrome 79.0.3945.79
  • Operating System (e.g. Windows, macOS, Ubuntu): Catalina 10.14.6

Notes

This seems to be fixed when you use templateCacheSize is set to 0.

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