-
-
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
[docs][base] Update useMenu
and useMenuItem
hooks demo
#34166
[docs][base] Update useMenu
and useMenuItem
hooks demo
#34166
Conversation
useMenu
and useMenuItem
hooks demo useMenu
and useMenuItem
hooks demo
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.
Pressing esc
should close the menu, similarly to the demos that use the unstyled component
Nice catch. Done. |
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.
One last thing, we should focus the trigger button when the menu closes, again similar to the unstyled component demo, maybe by using something like:
const close = () => {
setAnchorEl(null);
buttonRef.current!.focus();
};
cc @danilo-leal to check if we need to add some focus indicator styles on the button/menu items.
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.
Looks great thanks! cc @danilo-leal we may wanna revisit the focus styles on the demos in general in the MUI Base docs.
Update
useMenu
anduseMenuItem
hooks demo which in turn fixes #31981. See #31981 (comment).Before: https://mui.com/base/react-menu
After: https://deploy-preview-34166--material-ui.netlify.app/base/react-menu
I've approved the Argos build
Preview: https://deploy-preview-34166--material-ui.netlify.app/base/react-menu/#hooks