File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ internal class CascadingMenuHelper
53
53
// This fallback is used if we fail to retrieve a value from the MenuShowDelay RegKey
54
54
const int DefaultMenuShowDelay = 400 ; // in milliseconds
55
55
56
+ // Uno-specific workaround (see comment below)
57
+ private Point ? _lastTargetPoint ;
58
+
56
59
public CascadingMenuHelper ( )
57
60
{
58
61
m_isPointerOver = false ;
@@ -567,6 +570,13 @@ internal void OpenSubMenu()
567
570
}
568
571
569
572
ownerAsSubMenuOwner . OpenSubMenu ( targetPoint ) ;
573
+ if ( _lastTargetPoint is { } lastTargetPoint )
574
+ {
575
+ // Uno-specific workaround: reapply the location calculated in OnPresenterSizeChanged(), since that one properly
576
+ // adjusts to keep submenu within screen bounds. (WinUI seemingly relies upon presenter.SizeChanged being raised
577
+ // every time submenu opens? On Uno it isn't.)
578
+ ownerAsSubMenuOwner . PositionSubMenu ( lastTargetPoint ) ;
579
+ }
570
580
ownerAsSubMenuOwner . RaiseAutomationPeerExpandCollapse ( true /* isOpen */ ) ;
571
581
ElementSoundPlayer . RequestInteractionSoundForElement ( ElementSoundKind . Invoke , ownerAsControl ) ;
572
582
}
@@ -932,6 +942,7 @@ internal void OnPresenterSizeChanged(
932
942
}
933
943
}
934
944
945
+ _lastTargetPoint = targetPoint ;
935
946
ownerAsSubMenuOwner . PositionSubMenu ( targetPoint ) ;
936
947
}
937
948
}
You can’t perform that action at this time.
0 commit comments