Browse Source

Don't treat a column-header double-click as a row activation

The metadata grid's double-tap handler activated grid.SelectedItem, so
rapidly clicking a column-header sort button registered as a double
click and navigated to the selected row. Resolve the row from the
double-tapped element instead and activate only when the double-click
actually landed on a data row.

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3755/head
Siegfried Pammer 1 month ago
parent
commit
a36f6d53a6
  1. 9
      ILSpy/Views/MetadataTablePage.axaml.cs

9
ILSpy/Views/MetadataTablePage.axaml.cs

@ -79,8 +79,13 @@ namespace ILSpy.Views
// in OnGridPointerPressed. // in OnGridPointerPressed.
if (DataContext is not MetadataTablePageModel page) if (DataContext is not MetadataTablePageModel page)
return; return;
var grid = this.FindControl<DataGrid>("Grid"); // Resolve the row from the double-tapped element rather than grid.SelectedItem: a
if (grid?.SelectedItem is { } row) // double-click on a column header (e.g. rapidly toggling its sort button) must NOT
// navigate to the currently-selected row — only a double-click on a data row does.
var visual = e.Source as Visual;
while (visual is not null and not DataGridRow)
visual = visual.GetVisualParent();
if (visual is DataGridRow { DataContext: { } row })
page.RaiseRowActivated(row); page.RaiseRowActivated(row);
} }

Loading…
Cancel
Save