punker76/gong-wpf-dragdrop

TabControl get wrong DropInfo index on empty tabcontrol space

DZL87 opened this issue · 0 comments

DZL87 commented

Describe the bug
When dragging overTabControl empty space, it makes DropInfo.IsertIndex = 0, instead of DropInfo.InsertIndex = itemsControl.Items.Count, like in ListBox for example.

Why this code is needed?
DropInfo.cs, line 56:
if (this.VisualTarget is TabControl)
{
if (!HitTestUtilities.HitTest4Type(this.VisualTarget, this.DropPosition))
{
return;
}
}

It works different than in ListBox.
Is there a reasonable case for it?

To Reproduce
Steps to reproduce the behavior:

  1. Drag tabItem out from tab header to empty tabControl space.

Expected behavior
Draw nearest border of TabControl instead of most left border of first tab.