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

Rapid Scrolling in TreeView Causes Application Crash in WinUI 3 #10248

Open
datskiy opened this issue Dec 19, 2024 · 1 comment
Open

Rapid Scrolling in TreeView Causes Application Crash in WinUI 3 #10248

datskiy opened this issue Dec 19, 2024 · 1 comment
Labels
area-TreeView bug Something isn't working

Comments

@datskiy
Copy link

datskiy commented Dec 19, 2024

Describe the bug

When scrolling quickly through the TreeView items in an "up-down-up-down" sequence, the application consistently crashes. This issue occurs with the item count enough to perform long scrolls and seems to be triggered only by rapid scrolling. The amount of scrolls required to trigger the issue varies, sometimes it crashes only after 3-4 such iterations.
Image

  • Slow scrolling as well as scrolling with a mouse wheel does not seem to cause any issues.
  • Similar controls such as ListView do not seem to cause such issues under the same conditions.

Exception Message
Source object type is not a projected type and does not inherit from a projected type. (Parameter 'value')

Stack Trace

at WinRT.CastExtensions.GetRefForObject(Object value)
at WinRT.CastExtensions.As[TInterface](Object value)
at TreeViewScrollingIssue.MainWindow.MainWindow_obj3_Bindings.SetDataRoot(Object newDataRoot) in \\TreeViewScrollingIssue\obj\x64\Debug\net8.0-windows10.0.19041.0\win-x64\MainWindow.g.cs:line 190
at TreeViewScrollingIssue.MainWindow.MainWindow_obj3_Bindings.ProcessBindings(Object item, Int32 itemIndex, Int32 phase, Int32& nextPhase) in \\TreeViewScrollingIssue\obj\x64\Debug\net8.0-windows10.0.19041.0\win-x64\MainWindow.g.cs:line 141
at ABI.Microsoft.UI.Xaml.Markup.IDataTemplateComponent.Do_Abi_ProcessBindings_1(IntPtr thisPtr, IntPtr item, Int32 itemIndex, Int32 phase, Int32* nextPhase)

Steps to reproduce the bug

  1. Run the project: https://github.com/datskiy/TreeViewScrollingIssue
  2. Start scrolling the TreeView quickly all the way up and down sequentially.
  3. Observe the unhandled exception and the application crash.

Expected behavior

The TreeView should handle rapid scrolling without crashing the application, like other similar controls.

Screenshots

Unhandled exception in VS
Image

NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

Windows version

Windows 11 (24H2): Build 26100

Additional context

Source code: https://github.com/datskiy/TreeViewScrollingIssue

@datskiy datskiy added the bug Something isn't working label Dec 19, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Dec 19, 2024
@karkarl karkarl added area-TreeView and removed needs-triage Issue needs to be triaged by the area owners labels Dec 19, 2024
@tpoint75
Copy link

I have a similar issue scrolling fast a listview with more than 10000 items on some pc.
But I could not reproduce it on my development computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TreeView bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants