Skip to content

Commit

Permalink
Reset mouse down location...
Browse files Browse the repository at this point in the history
.. on release or capture lost. Fixes an issue with phantom drags occurring on macOS due to AvaloniaUI/Avalonia#16936
  • Loading branch information
grokys committed Sep 12, 2024
1 parent 38dce08 commit e475438
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ protected override void OnPointerMoved(PointerEventArgs e)
owner?.RaiseRowDragStarted(e);
}

protected override void OnPointerReleased(PointerReleasedEventArgs e)
{
base.OnPointerReleased(e);
_mouseDownPosition = s_InvalidPoint;
}

protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e)
{
base.OnPointerCaptureLost(e);
_mouseDownPosition = s_InvalidPoint;
}

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
if (change.Property == IsSelectedProperty)
Expand Down

0 comments on commit e475438

Please sign in to comment.