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 items stop responding as Drag and Drop targets #9043

Open
jeromelaban opened this issue Nov 2, 2023 · 5 comments
Open

ListView items stop responding as Drag and Drop targets #9043

jeromelaban opened this issue Nov 2, 2023 · 5 comments
Labels
area-DragAndDrop area-Lists ListView, GridView, ListBox, etc bug Something isn't working team-Controls Issue for the Controls team

Comments

@jeromelaban
Copy link

Describe the bug

List view items are no longer receiving drag events after a few manipulations.

In the repro attached below, there is a long list of items that can be dragged and are re-parented when dropped on top of another item (simulating a file explorer type view where a folder is dragged onto another folder, moving it inside the folder, etc.).

Steps to reproduce the bug

Dragging items within the initial view works as expected, however, when dragging and scrolling other items into view (using the mousewheel, etc.) the new items no longer react as drop targets.

DragAndDrop-Cleaned.zip

Expected behavior

Dropping on items keeps working.

Screenshots

image image

NuGet package version

WinUI 3 - Windows App SDK 1.4.2: 1.4.231008000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@jeromelaban jeromelaban added the bug Something isn't working label Nov 2, 2023
@bpulliam bpulliam added area-Lists ListView, GridView, ListBox, etc team-Controls Issue for the Controls team area-DragAndDrop labels Nov 9, 2023
@ranjeshj
Copy link
Contributor

@jeromelaban I'm not able to repro this with WinUI3 Gallery sample app (ListView with drag and drop sample). Can you give it a try there and provide the specific set of steps you perform to get into this state?

@darenm
Copy link

darenm commented Nov 20, 2023

@ranjeshj did you try with the reproduction sample attached above (I have duplicated the link to it below). We have only seen this in nontrivial cases.

https://github.com/microsoft/microsoft-ui-xaml/files/13242965/DragAndDrop-Cleaned.zip

In the attached repro:

  1. Click and drag Item 1.
  2. Hover over item 10 - note that it is a valid drop target.
  3. While continuing to keep the left mouse button pressed so that item 1 remains "dragged", using the mouse wheel, scroll the list view so that item 55 comes into view.
  4. Hover item 1 over item 55 - note that it is not a valid drag target.

Expected outcome - item 55 is a valid drop target.

@ranjeshj
Copy link
Contributor

ranjeshj commented Dec 1, 2023

Thanks. I can repro it with the app. Looks like the drag drop behavior is all custom in the app. Is there a reason for not using the built in ListView's drag drop? Its a bit more complicated with ListView because it virtualizes/recycles items.

@darenm
Copy link

darenm commented Dec 1, 2023

@ranjeshj Yes - we have a complex data layer that sits "behind" this visual representation of the data. The ListView is effectively presenting a view model - the custom logic has to perform the underlying data operations. In this reproduction, I removed the data logic for "simplicity" while keeping the overall structure. We have assumed that the issue is related to virtualization but feels like the events should still be raised...

@darenm
Copy link

darenm commented Jan 15, 2024

@ranjeshj Are there any updates on this? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DragAndDrop area-Lists ListView, GridView, ListBox, etc bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants