Skip to content

Expansion panel ordering issue with Virtual Scroll #13696

@trevorsmiley

Description

@trevorsmiley

Bug, feature request, or proposal:

cdkVirtualScroll does not work properly with matAccordion and matExpansionPanel.

On first display the order of items in the cdkVirtualFor is incorrect until you scroll down a bit

What is the expected behavior?

Item order is maintained

What is the current behavior?

For elements 0-100000, items 13->4 are shown first until you scroll down and back up then the order is slightly fixed to 0->x (depending on how far you scrolled). If you scroll far enough and then back up then the order is fully corrected to 0->100000

What are the steps to reproduce?

Stackblitz example

What is the use-case or motivation for changing an existing behavior?

Able to use expansion panels inside virtual scroll

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 7.0
Material 7.0
MacOS 10.14
TypeScript 3.x
Browser Chrome 70.0

Is there anything else we should know?

No

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/scrollingarea: material/expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions