Skip to content

Commit 2aff85c

Browse files
committed
fixed #882
1 parent a879ebc commit 2aff85c

File tree

1 file changed

+5
-1
lines changed
  • src/Shared/HandyControl_Shared/Controls/TabControl

1 file changed

+5
-1
lines changed

src/Shared/HandyControl_Shared/Controls/TabControl/TabItem.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ public ContextMenu Menu
225225
/// <param name="oldIndex"></param>
226226
private void UpdateItemOffsetX(int oldIndex)
227227
{
228-
if (!_isDragging) return;
228+
if (!_isDragging || CurrentIndex >= TabPanel.ItemDic.Count)
229+
{
230+
return;
231+
}
232+
229233
var moveItem = TabPanel.ItemDic[CurrentIndex];
230234
moveItem.CurrentIndex -= CurrentIndex - oldIndex;
231235
var offsetX = moveItem.TargetOffsetX;

0 commit comments

Comments
 (0)