-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Menu] Dropdown + onMouseOver => Dropdown open forever #16651
Comments
@romainquellec Thanks for opening this issue. I think that it's a use case we should support natively. Triggering an action on a hover event is often not a great idea. The purpose of a hover state is to indicate something is clickable or to provide quick information, e.g. tooltip. The click should be reserved for doing actions. But they might be cases where it's valid. I think that this issue highlights our lack of a good dropdown story for the library. |
You're welcome ! Do you suggest I wait for a component ? Have you a quick fix in mind ? |
I'm missing the connection between the demo and the initial statement. For dropdowns we have the The issue with the demo is that you mouseout of the window and you get in this weird limbo where you never actually moused out. We can probably fix the Could you record a video with the interaction you wouldn't expect? Best in a more isolated environment i.e. not directly at the edge of the screen. |
Well, no.
I choose this way of doing following some issues about dropdown (#10804) If you know a better way of doing a dropdown, or if I did something wrong, just just tell me, but, again, this issue seems pretty clear to me. |
Alternative I found : https://jcoreio.github.io/material-ui-popup-state/ here (#9893) |
A dropdown is already implemented in https://material-ui.com/components/selects/#simple-select or with less boilerplate https://material-ui.com/components/text-fields/ In your demo I only see a menu that should open on hover. That's a bit more tricky to achieve since we have to deal with the backdrop and what should happen when I click on the button when the menu is open. You're probably better of implementing this with a Popper. The Popover is a more disruptive UI that's not very well suited for mouseover interactions. So I would either recommend subscribing to #9893 or ask on SO/spectrum how to implement a menu that opens on hover. |
"A dropdown is already implemented". To be clear, to me : A dropdown is not a select. (Maybe, you call that a Menu) A Select is an "overlay" that allow a user to select a value from a series of options (in a form) |
Facing pretty much the same issue. Though in my use case, am having a selection with menu items as options. |
Expected Behavior 🤔
When I use a Menu like a Dropdown with onMouseOver, when I dont go on the dropdown, the dropdown doesnt close by itself (see example)
Current Behavior 😯
Well, I said everything already. Maybe, I've done something wrong, but I dont see how to do it with my current knowledge of mui.
Steps to Reproduce 🕹
https://codesandbox.io/s/material-demo-nbki0
If you mouseover the button and go left without touching the dropdown, the dropdown will be open forever. How to fix that simply ?
The text was updated successfully, but these errors were encountered: