-
Notifications
You must be signed in to change notification settings - Fork 776
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
There is no way to control the hover, focus, and focus-visible styles for DropdownMenuItem #1164
Comments
Hi @KelvinOm, This is really by design. |
Hi @benoitgrelard. Thank you so much for such a quick response. I understand your arguments about one focused element and agree with them. But what about making different styles for mouse and keyboard. I mean different styles for |
The problem with |
I got you. Thanks! 👍 |
@benoitgrelard Could you please add this information to the docs? I believe it can save some time for consumers of Radix. |
I understand your position. But for me as a consumer, there is no way to make consistent behavior for the dropdown menu and for the toolbar. Only if I fork dropdown menu, which is completely wrong in my opinion. I still think it's not very right not to give consumers the opportunity to be able to adjust the state of the hover in the dropdown menu. As a library, you can give recommendations on best practices, and from my perspective, this is the best approach. This will allow the library to be more flexible. |
What do you mean by that? The |
I can decide I want to use hover or not in
You could give consumers the ability to customize states. Anyway, thanks a lot for the answers and for the excellent library! 👍 |
I guess the point I'm trying to make is that it's not really just us deciding we should do it this way. It's a well established UX/accessibility pattern that has been designed/used by many other people far more experienced than us. As an example, here are native menus (dropdown and menubar) and native select in MacOS: Screen.Recording.2022-02-21.at.11.33.31.movScreen.Recording.2022-02-21.at.11.34.05.movScreen.Recording.2022-02-21.at.11.34.44.mov |
@benoitgrelard I understand all this and accept it. I'm just trying to say that if the library provides this opportunity then it would become a little more flexible. We cannot know all the cases of using the component and sometimes it may be necessary to do something custom. |
Another case. If the Screen.Recording.2022-02-22.at.11.06.34.mov |
@KelvinOm That will be fixed by the following proposed change #956 (comment) |
@jjenzz is it expected to have the proposed change being released soon? |
@ivanbanov i'm not on the modulz team anymore i'm afraid so perhaps @benoitgrelard or @andy-hook can help? |
I am closing this issue now as I have captured the request for the enhancement in a new issue: #1289 |
If we need more flexibility about when use focus style, maybe we can use library such as what-input in addition of radix-ui. |
@benoitgrelard Also there is no option to open the DropMenuContent while hovering it .In the docs dropdown works only when clicking the DropMenuTrigger Items . |
Bug report
There is no possibility to set styles for hover, focus, and focus-visible states separately for DropdownMenuItem
Current Behavior
The focus is set automatically and because of this, even just when hovering, the elements are in focus.
Expected behavior
It is possible to apply different styles for different states
Example: https://www.w3.org/TR/wai-aria-practices-1.1/examples/menubar/menubar-1/menubar-1.html#
Reproducible example
Here is an attempt to apply different styles for DropdownMenuItem. Please take a look at lines 71-73
https://codesandbox.io/s/naughty-chebyshev-bhnv3f?file=/App.js
The text was updated successfully, but these errors were encountered: