Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JLucasK opened this issue Nov 15, 2024 · 2 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@JLucasK
Copy link

JLucasK commented Nov 15, 2024

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

<ScrollViewer>
    <StackPanel>
        <!-- Extra content to give give the ScrollViewer extra content -->
        <ListView
            ItemsSource="{x:Bind Items}"
            ScrollViewer.HorizontalScrollBarVisibility="Auto"
            ScrollViewer.HorizontalScrollMode="Auto">
            <ListView.ItemTemplate>
                <DataTemplate x:DataType="x:String">
                    <TextBlock Text="{x:Bind}" />
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <!-- Extra content to give give the ScrollViewer extra content -->
    </StackPanel>
</ScrollViewer> 
// Property
public List<string> Items { get; set; }

// Assignment

Items = new List<string>()
{
    "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

NuGet package version

None

Windows version

No response

Additional context

Using Microsoft.WindowsAppSDK 1.6.240923002

@JLucasK JLucasK added the bug Something isn't working label Nov 15, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 15, 2024
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@JLucasK
Copy link
Author

JLucasK commented Nov 15, 2024

Additionally, it seems like setting a Height on the ListView that is less than its DesiredHeight causes the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

1 participant