Skip to content
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

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Sep 1, 2022

@ZeeshanTamboli ZeeshanTamboli added docs Improvements or additions to the documentation component: menu This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Sep 1, 2022
@mui-bot
Copy link

mui-bot commented Sep 1, 2022

No bundle size changes

Generated by 🚫 dangerJS against 8a3cc07

@ZeeshanTamboli ZeeshanTamboli changed the title [docs] Update useMenu and useMenuItem hooks demo [docs][base] Update useMenu and useMenuItem hooks demo Sep 1, 2022
@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review September 2, 2022 11:21
Copy link
Member

@mnajdova mnajdova left a 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

@ZeeshanTamboli
Copy link
Member Author

Pressing esc should close the menu, similarly to the demos that use the unstyled component

Nice catch. Done.

Copy link
Member

@mnajdova mnajdova left a 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.

Copy link
Member

@mnajdova mnajdova left a 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.

@ZeeshanTamboli ZeeshanTamboli merged commit 17695ff into mui:master Sep 26, 2022
@ZeeshanTamboli ZeeshanTamboli deleted the issue/31981-menu-unstyled-base-docs-autfocus-fix branch September 26, 2022 06:50
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Menu unstyled page auto focus to useMenu and useMenuItem hooks demo
3 participants