punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
BSD 3-Clause "New" or "Revised" License
2.28k stars 400 forks source link

Nested TabControl adorner visual bug #482

Open bors97 opened 8 months ago

bors97 commented 8 months ago

Describe the bug In case of a nested TabControl when dragging a TabItem the adorner's top part sinks to the child TabControl's height. Another (possibly) related bug is that you can drag on the child TabItem and it starts dragging the parent TabItem that is straight above the dragged child TabItem.

To Reproduce Steps to reproduce the behavior:

  1. Create a nested tabcontrol
  2. Enable Drag and Drop on the parent Tab
  3. Drag either the parent or child TabItem.

Expected behavior The adorner's top part is on the top of the dragged item.

Screenshots image

Desktop (please complete the following information):

bors97 commented 8 months ago

After some testing the issue seems to be that the GetVisualDescendents method searches by depth for the TabPanel instead of breadth, which leads to it finding the content's TabControl's TabPanel first. Replacing the current search with a breadth-first search algorithm seems to solve the issue.