-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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][base-ui] Focus Menu Items on hover #40755
Conversation
Netlify deploy previewhttps://deploy-preview-40755--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good! I added the fix to the CSS stylesheet too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment 😊
@@ -55,6 +55,7 @@ export function useMenuItem(params: UseMenuItemParameters): UseMenuItemReturnVal | |||
|
|||
const { getRootProps: getListRootProps, highlighted } = useListItem({ | |||
item: id, | |||
handlePointerOverEvents: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a parameter to useMenuItem
to control this so the behavior can be modified. This is required for Material that has different hover and focus states.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Co-authored-by: zanivan <victorzanivan@gmail.com>
Hovering over a menu item focuses it immediately, so we don't have a separate hover and focus states.
I changed the :focus-visible styles to :focus and removed the :hover styles.
Preview: https://deploy-preview-40755--material-ui.netlify.app/base-ui/react-menu/
Closes #40595
Closes #40597