Browse Source

Escape closes the flags-filter popup

Standard popup convention; the chips/pills inside don't override KeyDown so
the Tunnel-routed handler on the popup root catches the key before any
inner control. Arrow-key navigation between chips is a bigger lift (chip
groups don't share a focus container) — leaving as a follow-up.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 2 months ago
parent
commit
a508ca5e65
  1. 15
      ILSpy/Metadata/MetadataColumnBuilder.cs

15
ILSpy/Metadata/MetadataColumnBuilder.cs

@ -352,12 +352,25 @@ namespace ILSpy.Metadata @@ -352,12 +352,25 @@ namespace ILSpy.Metadata
popupRoot.AddHandler(global::Avalonia.Input.InputElement.PointerWheelChangedEvent,
(_, e) => e.Handled = true,
handledEventsToo: true);
return new Popup {
var popup = new Popup {
PlacementTarget = placementTarget,
Placement = PlacementMode.BottomEdgeAlignedLeft,
IsLightDismissEnabled = true,
Child = popupRoot,
};
// Escape closes the popup — matches the standard popup convention. Tunnel
// routing on the popup root so the key is intercepted before any inner control
// (e.g. the TextBox in a flag-name search field) tries to consume it.
popupRoot.AddHandler(global::Avalonia.Input.InputElement.KeyDownEvent,
(_, e) => {
if (e.Key == global::Avalonia.Input.Key.Escape)
{
popup.IsOpen = false;
e.Handled = true;
}
},
global::Avalonia.Interactivity.RoutingStrategies.Tunnel);
return popup;
}
static DataGridTextColumn BuildTextColumn(PropertyInfo prop, ColumnInfoAttribute? info)

Loading…
Cancel
Save