MudMenu: Fix pointer event timing with cascading menus#10551
MudMenu: Fix pointer event timing with cascading menus#10551danielchalmers merged 2 commits intoMudBlazor:devfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #10551 +/- ##
=======================================
Coverage 91.55% 91.56%
=======================================
Files 426 426
Lines 13305 13308 +3
Branches 2565 2567 +2
=======================================
+ Hits 12182 12185 +3
Misses 548 548
Partials 575 575 ☔ View full report in Codecov by Sentry. |
|
@danielchalmers one additional optimization would be to switch the side where the menu opens depending on the available width. Currently they start to overlap, chrome for example opens to the left and then to the right and then to the left again. That way the last two layers are always visible and not overlapping. |
Do you have a screenshot for reference? @dennisrahmen |
|
|
@danielchalmers if you check out the example and open the second layer "Format" and then try to open "Points" you have to be fast otherwise it just opens "Text" and that overlaps with the options of the second layer. Aufzeichnung.2025-01-03.194106.mp4In comparison the browser menu alternates to which side it opens the new layer. That way the new layer is never in the way even when you are slow or just want to check what menu the option you are searching for is in. Aufzeichnung.2025-01-03.194652.mp4 |
|
@versile2 What do you think about @dennisrahmen's idea above and the complexity of adding it? |
|
well I envision it would be handled in C# to alternate transformorigin. Nullable like AnchorOrigin so they can override it but otherwise alternate left/right on a nested menu. The popover stuff would do what it does now. Honestly I wish it wouldn't make them all the same width too but that might be customizable. |
|
But in either case assuming they set the transform and anchors on every nest they could control it. |
Do they need to override it? The menu that opens from the activator, so the first layer, it does not matter where it opens. I would consider this normal behaviour for every menu in that style I have ever used. |
|
No, they don't have to override it, but we've specifically allowed them to override AnchorOrigin so I presumed we could allow them to override TransformOrigin here as well using the same method. |



Description
Improves code readability, fixes potential rendering desync, optimizes method calls, and fixes this:
Video3.mp4
How Has This Been Tested?
Type of Changes
Checklist
dev).