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

Drag and Drop across second root node has args.OriginalSource incorrect value #7266

Closed
1 of 2 tasks
terrycox opened this issue Jun 21, 2022 · 1 comment
Closed
1 of 2 tasks
Labels
bug Something isn't working no-issue-activity product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team

Comments

@terrycox
Copy link

Describe the bug

The attached sample replicate an issue in which we're unable to block a drag and drop operation on a TreeView involving two roots. Nodes under the first root should only be allowed to drop under the first root.

When dragging a TreeViewItem below the first root node across the second root node, OnDragEnter is passed as both sender and args.OriginalSource containing the second root node. In other words, args.OriginalSource is no longer the node we started dragging.

Steps to reproduce the bug

  1. Run the attached sample.
  2. Drag a node below the first root above the first root. The drag operation will be blocked.
  3. Drag a node below the first root below the second root. The debug statements will show that when OnDragEnter is invoked when the node being dragged over us the second root, both sender and args.OriginalSource report the second root node.
    The node will report as invalid for the drop using the attempted edits, but the drop will proceed anyway.
    TreeViewDragAndDrop.zip

Expected behavior

Nodes dragged over which report as invalid are allowed to drop even though marked has Handled.

Screenshots

No response

NuGet package version

No response

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows 11 (22H2): Build 22621

Additional context

We are also uncertain as to what effect calling base.OnDragEnter(args) has, if any, although it's referred to in the UIElement.OnDragEnter documentation.

A clear and concise example of drag and drop relating to TreeView would be very useful.

@terrycox terrycox added the bug Something isn't working label Jun 21, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jun 21, 2022
@ojhad ojhad added team-Rendering Issue for the Rendering team product-winui3 WinUI 3 issues labels Jul 7, 2022
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Dec 7, 2022
@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

3 participants