Skip to content

Commit 6b6f0c2

Browse files
authored
Merge pull request #259 from w-ahmad/fix/filterflyout-closes-on-space
fix: Prevent MenuFlyout click action on Space key press
2 parents 6adc201 + e6a8478 commit 6b6f0c2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/TableViewColumnHeader.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ protected override void OnApplyTemplate()
257257
#else
258258
_searchBox.KeyDown += OnSearchBoxKeyDown;
259259
#endif
260+
// Handle Space key to prevent MenuFlyoutItem performing click action.
261+
menuItem.PreviewKeyUp += static (_, e) => e.Handled = e.Key is VirtualKey.Space;
260262
}
261263

262264
SetFilterButtonVisibility();
@@ -610,4 +612,4 @@ internal void EnsureGridLines()
610612
/// Gets a value indicating whether the cursor is in the sizing area.
611613
/// </summary>
612614
private bool IsSizingCursor => ProtectedCursor is InputSystemCursor { CursorShape: InputSystemCursorShape.SizeWestEast };
613-
}
615+
}

0 commit comments

Comments
 (0)