Skip to content

bug(CDK/SCROLLING): <object> element in *cdkVirtualFor is glitching when using "templateCacheSize: 0" #28021

Open
@slivniy

Description

@slivniy

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

When using No cache strategy (templateCacheSize: 0) for *cdkVirtualFor with element (as image), elements of list glitch while scrolling. Seems like cdkVirtualFor incorrectly init/reinit or reuse instances of listed elements.

When using tag instead of no bug detected.

Reproduction

StackBlitz link: https://stackblitz.com/edit/uyv2wg?file=src%2Fexample%2Fcdk-virtual-scroll-template-cache-example.html
Steps to reproduce:

  1. Create list of 100 elements, use with image link data.
  2. Scroll
  3. Expected Behavior

    Smooth scrolling, correct reusing/reinit of list elements, no content replacing.

    Actual Behavior

    Scrolling is not smooth (end sometimes end / start of list is unreachable), elements in list are replaced by content of sibling.

    Environment

    • Angular: 17.0.0-rc.0 (and 15)
    • CDK/Material: 16.2.10
    • Browser(s): Chrome
    • Operating System (e.g. Windows, macOS, Ubuntu): macOs

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: cdk/scrolling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions