-
Notifications
You must be signed in to change notification settings - Fork 691
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 and GridView with Grouping crash with AccessViolation on Drag #9119
Comments
@lukasf drag and drop/reorder in grouped listview/gridview is not supported currently. I've marked this as a feature request. |
Come on, this is not a feature request. This is a bug. This is base functionality that has worked in every other XAML UI framework. |
I have looked into the implementation and I think I might have found the issue. Please check this line:
In all other places in this method, pDirectManipulationService is checked against null, before it is accessed. So obviously it can be null when the method is called. But in this line, the interface is used directly, without any check. And I get a AccessViolation from this exact method. I do not see any other unchecked calls in this method, so I am pretty confident that this is the exact place where the crash occurs. I guess, instead of calling the method directly, it should be checked, and if null, the translation values must be calculated manually, like in the loop above:
Please look into this, it is super easy to reproduce and it could be easy to solve. This is a really important scenario. Unfortunately, it is not possible for me to compile WinUI 3, there are no build instructions whatsoever, which is a shame. A lot of the WinUI bugs could probably be solved by the community, if only we had access to complete sources and build system. We see that you are pretty much understaffed to do all this work. You should really work towards open sourcing WinUI3, even if not all of it is translated to C++/winrt yet. A lot of devs know plain C++ just as well. |
Thanks much for your input @lukasf. You were right about the needed changes, and they will be part of the next WinUI3 release. |
Describe the bug
When a ListView or GridView has Grouping enabled and AllowDrop=true, then when drag+drop something into the view area where scrolling should start, it crashes with AccessViolation.
The crash occurs exactly at the point where the list/grid would start scrolling up or down when dragging near the upper or lower area of the view. StackTrace shows it is probably trying to set the scroll velocity on something that is NULL. Dragging in the center works without crash, since no scrolling is required.
Steps to reproduce the bug
Please try attached sample. Drag e.g. some File from Windows Explorer into the middle of the view. No crash. Now move it near the bottom of the list. BANG. Watch it go down.
ListViewDragCrash.zip
Expected behavior
Drag+Drop is a super important scenario. Grouping is super important too. It should be possible to use both without issues.
AccesViolation is the worst type of error. It should never ever occur.
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.4.2: 1.4.231008000 (crash has occured since I started with WinUI on 1.2.x)
Windows version
Windows 11 (22H2): Build 22621
Additional context
The text was updated successfully, but these errors were encountered: