I would like an option to be available for MdMenu that will open it when the mouse is over the menu element, and close it when the mouse leaves the menu element, or the menu dropdown.
It seems that the main interface into MdMenu is where the user should click on it. This is unacceptable for my use case.
There is also a programmatic API. However, it will be extremely tricky for me to trigger on mouse leave of the entire menu dropdown (though I probably could do on mouse leave of the menu icon).
I would like to mimic a menu structure similar to what airbnb has on their site (go to airbnb.com, login and look at the user profile). It opens as soon as you mouse over it.
All.
Hey @davidwilcox your use case is not part of the Material Design Specification guidelines that we aim to fully implement in Angular Material, you can implement this sort of functionality with our Overlay component and custom triggers.
CC @jelbourn
What @EladBezalel said.
Please consider the following:
angular/cdk
).@EladBezalel : Any conclusion on this thread?
Well, @AKlaus is kind of right when in the spec they don't mention "clicks only".
IMO the clunky
solution is not the best but actually pretty fine.
Do you find any particular issues with that solution?
What are your expectations from the api to be?
The decision on opening the menu either on click or on hovering the mouse cursor must be on the developers. From the UI/UX point of view, choosing between these two options depends on multiple factors, e.g.
One thing that I've thought about since filing this is that "mouseover" has no real meaning in mobile. If I'm not mistaken one big part of material design is mobile friendly. How would this work on mobile?
@AKlaus Thanks for the detailed comment, i do get what you're saying, regarding @davidwilcox comment, we can make assure it would be 'click only' in mobile with the cdk screen size breakpoints.
@jelbourn what do you think?
@davidwilcox, from the user's perspective, it would be no difference between the "_mouse over_" and "_mouse click_" on the touch screens.
@AKlaus - thanks for covering up the scenarios. We, infact stuck here - "..Ideally, the menu would become hidden if the mouse cursor is outside of the area (which includes the button, the menu and sub-menus)..".
We may achieve this by again a hack around, but looking forward to hear from @EladBezalel / @jelbourn
The problem is that horrible cdk-overlay-backdrop that avoids a good horizontal main-menu with vertical sub-menus. Could we use horizontal mat-menus with sub-menus instead of buttons? In this case they would open on mouseenter...
Any news on this issue? I don't understand why it is closed, this is a logical feature request since the overhead of workaround is too much and not complete as expected.
Do we have a solution to the problem we discussed in this issue?
+1
I like how 90% of common, expected, broadly understood user interface patterns are disregarded by the material team here because it's 'not in the material spec'.
@AaronLavers I second you on this sir, They're trying to follow it as Bible I guess.
The problem I see with the material spec: It's written for mobile. So a mouse over or mouse enter simply isn't being ocnsidered. mobile-frinedly doesn't necessarily mean mobile-first.
This is definitely something to be desired when using a mouse.
The funny thing is, that sub menus automatically open up on hover, but there is no configuration supported for main menus. Is there any workaround to fix issues mentioned by @AKlaus in the attached SO answer?
Solution provided here How to open and close Angular mat menu on hover
@Marshal27, solution provided is breaking in touch devices.
expected: should open on touch and stay till tap
current: but menu getting automatically closed.
@gshireesh the solution provided in the stackblitz link of the Stack Overflow answer has the expected behavior you described, via my Android device. Please review the stackbkitz, also post additional details via Stack Overflow if the stackblitz is not working for you.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Please consider the following:
angular/cdk
).