microsoft / microsoft/microsoft-ui-xaml

ListView with Horizontal Scrolling nested in a ScrollViewer does not allow the parent container to vertically scroll with the mouse wheel

Open
#10,172 3 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

A `ListView` that has horizontal scrolling active (desired width is greater than the available width) does not allow a parent `ScrollViewer` to vertically scroll with the mouse wheel.

In my testing, touch pad and touch seem work work, just the mouse scroll wheel exhibits the issue.

Additionally, horizontally scrolling the vertical `ScrollViewer` using a mouse with a dedicated horizontal scroll wheel causes the viewer to scroll up and down. Not sure if that's related, but something else I observed.

### Steps to reproduce the bug

Either add code like the following or run this sample project: [ScrollTestWinui.zip](https://github.com/user-attachments/files/17779510/ScrollTestWinui.zip)

```xml













```

```cs
// Property
public List Items { get; set; }

// Assignment

Items = new List()
{
"Test","test1","test2","test3","scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll scroll "
};
```

Then, size the window such that the `ListView` does not need to scroll horizontally. Place the cursor on the `ListView` and try to scroll vertically with your mouse wheel. The parent `ScrollViewer` should scroll successfully.

Now, size the window such that the `ListView` **does** need to scroll horizontally. Place the cursor on the `ListView` and try to scroll vertically with your mouse wheel. The parent `ScrollViewer` does not scroll successfully.

_Additional Obsevation_

Size the window to any size, but place your cursor on the area not included by the `ListView`. Horizontally scroll with a mouse that has a horizontal scroll wheel. The `ScrollViewer` scrolls vertically.

### Expected behavior

Attempting to vertically scroll when a `ListView` is not vertically scrollable and is inside of a `ScrollViewer` should cause the `ScrollViewer` to scroll

### Screenshots

Attached sample project should look like this.
![Image](https://github.com/user-attachments/assets/3c53c97b-6030-412f-8190-707b26c6b9ac)

### NuGet package version

None

### Windows version

_No response_

### Additional context

Using Microsoft.WindowsAppSDK 1.6.240923002

Contributor guide

Open the contributing guide

Research direction

Start with the attached ScrollTestWinui.zip reproduction and compare mouse-wheel routing between the ListView and its parent ScrollViewer when horizontal scrolling is enabled. Trace the ListView/ScrollViewer input handling in the WinUI source. Done means vertical wheel input reaches the parent when the ListView is not vertically scrollable, while horizontal scrolling remains correct.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.