Menu: Stay open after being clicked with MouseOver#9513
Menu: Stay open after being clicked with MouseOver#9513henon merged 18 commits intoMudBlazor:devfrom
MouseOver#9513Conversation
Closes MudBlazor#9470 Potential future improvements: - Expand MouseEvent and make it a flag enum? - Context menu will always be prevented for long touches
MouseOver
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #9513 +/- ##
==========================================
+ Coverage 89.82% 90.52% +0.69%
==========================================
Files 412 407 -5
Lines 11878 12741 +863
Branches 2364 2474 +110
==========================================
+ Hits 10670 11534 +864
+ Misses 681 643 -38
- Partials 527 564 +37 ☔ View full report in Codecov by Sentry. |
| // Wait a bit to allow the cursor to move from the activator to the items popover. | ||
| await Task.Delay(100); |
There was a problem hiding this comment.
We should probably make this timespan configurable via globals, what do you think?
There was a problem hiding this comment.
But seeing as it has already been that way, this can be done later or maybe it isn't needed at all.
There was a problem hiding this comment.
It's a little awkward because if you set it too low you won't be able to move the cursor to the menu. I've been trying to think of a way to remove it altogether and avoid any timing issues
There was a problem hiding this comment.
It's needed because the menu is separated from the activator, but maybe we extend the hit bounds while keeping that part visually transparent
Will investigate further in the future
Description
Closes #9470 by refactoring some of the menu code and allowing you to click the activator to keep the menu open while using MouseOver. This is relevant on touch devices where you can't hover, so the menu would only stay open as long as you held a tap.
Tried to avoid any breaking changes.
How Has This Been Tested?
unit, visually
Type of Changes
Clicking the button will toggle the overlay, allowing you to hide the menu. If it's already closed (like if touched) then it will stay open until you click the overlay.
Touch:
video3.mp4
Mouse:
video4.mp4
Checklist
dev).