[docs][base] Update useMenu and useMenuItem hooks demo #34166
Merged
ZeeshanTamboli merged 8 commits intomui:masterfrom Sep 26, 2022
Merged
Conversation
useMenu and useMenuItem hooks demo useMenu and useMenuItem hooks demo
1 task
mnajdova
requested changes
Sep 23, 2022
Member
mnajdova
left a comment
There was a problem hiding this comment.
Pressing esc should close the menu, similarly to the demos that use the unstyled component
Member
Author
Nice catch. Done. |
mnajdova
reviewed
Sep 23, 2022
Member
mnajdova
left a comment
There was a problem hiding this comment.
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.
mnajdova
approved these changes
Sep 26, 2022
Member
mnajdova
left a comment
There was a problem hiding this comment.
Looks great thanks! cc @danilo-leal we may wanna revisit the focus styles on the demos in general in the MUI Base docs.
alexfauquette
pushed a commit
to alexfauquette/material-ui
that referenced
this pull request
Oct 14, 2022
daniel-rabe
pushed a commit
to daniel-rabe/material-ui
that referenced
this pull request
Nov 29, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
useMenuanduseMenuItemhooks 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