Fix NavMenu selection on right-click (#819)

* Initial plan

* Fix NavMenu right-click behavior - prevent selection on right-click

Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rabbitism <14807942+rabbitism@users.noreply.github.com>
This commit is contained in:
Copilot
2025-11-12 15:33:18 +08:00
committed by GitHub
parent f9729859fe
commit 0ab084b198
2 changed files with 42 additions and 3 deletions

View File

@@ -308,8 +308,7 @@ public class NavMenuItem : HeaderedItemsControl
if (e.Handled) return;
var p = e.GetCurrentPoint(this);
if (p.Properties.PointerUpdateKind is not (PointerUpdateKind.LeftButtonPressed
or PointerUpdateKind.RightButtonPressed)) return;
if (p.Properties.PointerUpdateKind is not PointerUpdateKind.LeftButtonPressed) return;
if (p.Pointer.Type == PointerType.Mouse)
ActivateMenuItem(e);
@@ -325,7 +324,7 @@ public class NavMenuItem : HeaderedItemsControl
_isPointerDown = false;
if (e.InitialPressMouseButton is MouseButton.Left or MouseButton.Right)
if (e.InitialPressMouseButton is MouseButton.Left)
{
var point = e.GetCurrentPoint(this);
if (new Rect(Bounds.Size).ContainsExclusive(point.Position) && e.Pointer.Type == PointerType.Touch)