microsoft / microsoft/microsoft-ui-xaml

Erratic Item Repositioning in ItemsRepeater with UniformGridLayout when Dragging Scroll Thumb (Introduced in 1.6-preview1)

Open
#9,972 2 comments 1 reaction 0 assignees View on GitHub
area-ItemsRepeater area-Scrolling bug team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When using an `ItemsRepeater` combined with a `UniformGridLayout` in a `ScrollView`, dragging the scroll thumb very quickly causes the items to reposition erratically when the scroll thumb is dragged afterward at any speed. This issue is more likely to occur if the controls inside the `ItemsRepeater` are heavier and take longer to load.

The issue does not occur when scrolling with the mouse wheel.
This bug was introduced in version `1.6-preview1`.

### Steps to reproduce the bug

- Create a `ScrollViewer` containing an `ItemsRepeater` that uses a `UniformGridLayout` as its layout.
- Populate the `ItemsRepeater` with a sufficient number of items.
- Use the scroll thumb to quickly drag the scroll bar up and down several times.
- After fast scrolling, try dragging the scroll thumb.
- Items in the `ItemsRepeater` should reposition erratically while dragging the scroll thumb slowly.

### Expected behavior

When dragging the scroll thumb, whether quickly or slowly, the items in the `ItemsRepeater` with `UniformGridLayout` should maintain their correct positions and render smoothly without any erratic repositioning.

It should comport itself like before version `1.6-preview1`.

### Screenshots

[_No response_](https://github.com/user-attachments/assets/983e4cae-6f1a-40d7-87bd-c4e71b53622f)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.0: 1.6.240829007

### Windows version

_No response_

### Additional context

Reproducible sample:
[UniformGridLayoutIssue.zip](https://github.com/user-attachments/files/16963017/UniformGridLayoutIssue.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the linked UniformGridLayoutIssue.zip sample and reproduce the behavior using an ItemsRepeater with UniformGridLayout inside a ScrollViewer. Compare fast and slow scroll-thumb dragging with the behavior before Windows App SDK 1.6-preview1. Done means items retain correct positions and render smoothly after repeated fast scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.