Skip to content

[menubar] Fix menubar ARIA structure to satisfy aria-required-children - #4027

Closed
ZeeshanTamboli wants to merge 1 commit into
mui:masterfrom
ZeeshanTamboli:issue-4004-menu-bar-accessibility
Closed

ZeeshanTamboli wants to merge 1 commit into
mui:masterfrom
ZeeshanTamboli:issue-4004-menu-bar-accessibility

Conversation

@ZeeshanTamboli

@ZeeshanTamboli ZeeshanTamboli commented Feb 9, 2026 •

Copy link
Copy Markdown
Member

Closes #4004

Tested with Lighthouse

Before: https://base-ui.com/react/components/menubar

Screenshot (66)

After: https://deploy-preview-4027--base-ui.netlify.app/react/components/menubar

Screenshot (68)

Also, tested it with NVDA screen-reader and nothing is announced wrongly atleast to me.

Used aria-hidden even though it is visually hidden, because it doesn't have the following styles as mentioned in the docs:

`aria-hidden="true"` should not be added when:

- The HTML `hidden` attribute is present
- The element or the element's ancestor is hidden with `display: none`
- The element or the element's ancestor is hidden with `visibility: hidden`

@ZeeshanTamboli ZeeshanTamboli added accessibility a11y component: menubar Changes related to the menubar component. labels Feb 9, 2026
@pkg-pr-new

pkg-pr-new Bot commented Feb 9, 2026

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@4027
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4027
    

commit: 0dc1a14

@mui-bot

mui-bot commented Feb 9, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+17B(0.00%) 🔺+2B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Feb 9, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 0dc1a14
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6989e4aea8ba090008270e6f
😎 Deploy Preview https://deploy-preview-4027--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ZeeshanTamboli
ZeeshanTamboli marked this pull request as ready for review February 9, 2026 13:53
@greptile-apps

greptile-apps Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR updates FloatingPortal to add aria-hidden on the visually-hidden helper <span aria-owns=...> that’s rendered when focus guards are enabled. The goal is to keep the aria-owns relationship for accessibility tooling while preventing the helper element from being exposed to assistive tech and from triggering aria-required-children violations in consumers (e.g., Menubar structure checks).

Confidence Score: 4/5

  • Mostly safe to merge once the aria-hidden attribute is fixed to a valid value.
  • The change is small and localized, but the current JSX aria-hidden boolean renders an invalid ARIA value (aria-hidden=""), which should be corrected to an explicit string to ensure consistent accessibility behavior.
  • packages/react/src/floating-ui-react/components/FloatingPortal.tsx

Important Files Changed

Filename Overview
packages/react/src/floating-ui-react/components/FloatingPortal.tsx Adds aria-hidden to a visually-hidden <span aria-owns> rendered alongside focus guards to avoid ARIA required-children violations.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@atomiks atomiks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the aria-owns association entirely and makes the element pointless. To give context, the element is necessary to preserve order when navigating between a trigger and its portaled popup using a virtual cursor (e.g. ctrl + option + left/right arrow with VoiceOver on Mac)

@ZeeshanTamboli

ZeeshanTamboli commented Feb 10, 2026 •

Copy link
Copy Markdown
Member Author

This breaks the aria-owns association entirely and makes the element pointless. To give context, the element is necessary to preserve order when navigating between a trigger and its portaled popup using a virtual cursor (e.g. ctrl + option + left/right arrow with VoiceOver on Mac)

I thought so.. Then what do you propose to fix the ARIA error mentioned in the related issue? Or perhaps we should ignore it?

@atomiks

atomiks commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Yeah I think it might be a "false positive", as it should also be erroring for the visually-hidden focus guards if any non-menuitem element isn't allowed.

@ZeeshanTamboli

Copy link
Copy Markdown
Member Author

Yeah I think it might be a "false positive", as it should also be erroring for the visually-hidden focus guards if any non-menuitem element isn't allowed.

The focus-guards have aria-hidden already set.

@atomiks

atomiks commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Oh right. I'm not sure how to fix it. We can leave it open if anyone has ideas.

@michaldudak

Copy link
Copy Markdown
Member

I'm trying out an alternative solution in #5058

@oliviertassinari
oliviertassinari requested a review from jjenzz as a code owner June 27, 2026 20:50
@zannager
zannager removed the request for review from mj12albert July 7, 2026 11:45
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 23, 2026
@michaldudak

Copy link
Copy Markdown
Member

Fixed in #5058

@ZeeshanTamboli
ZeeshanTamboli deleted the issue-4004-menu-bar-accessibility branch August 13, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y component: menubar Changes related to the menubar component. PR: out-of-date The pull request has merge conflicts and can't be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[menubar] when dropped down, has children which are not allowed: span[aria-owns]

4 participants