Skip to content

ItemsRepeater inside ScrollViewer, DataContext inconsistencies #21

@hahagu

Description

@hahagu

Describe the bug
Using the ItemsRepeater inside ScrollViewer causes inconsistencies with DataContext.
When I scroll to the end of the ScrollViewer, or close to, the first few items' DataContext becomes null,
and when going back up, it may get mixed around with other objects.

To Reproduce

Steps to reproduce the behavior:

  1. Have a ItemsRepeater control inside ScrollViewer and populate
  2. Populate the ItemsRepeater
  3. Scroll down the ScrollViewer far enough
  4. Monitor the DataContext of ItemsRepeater

Expected behavior

DataContext is supposed to not become null, or get jumbled around.

Screenshots

bug_case.mp4

Desktop (please complete the following information):

  • OS: Windows 11 22H2
  • Version Avalonia 11.0.4

Additional context

Bug case minimal reproducible example
bug_case.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions