Skip to content

[menu][select][combobox][scroll area] Hide group labels and scrollbars from the accessibility tree - #5598

Merged
atomiks merged 3 commits into
mui:masterfrom
azeng4499:feature/hide-group-labels-and-scrollbars-from-accessibility-tree
Aug 31, 2026
Merged

[menu][select][combobox][scroll area] Hide group labels and scrollbars from the accessibility tree#5598
atomiks merged 3 commits into
mui:masterfrom
azeng4499:feature/hide-group-labels-and-scrollbars-from-accessibility-tree

Conversation

@azeng4499

@azeng4499 azeng4499 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Menu.GroupLabel and ScrollArea.Scrollbar are exposed in the accessibility tree, which causes problems for the screen reader:

  • ScrollArea.Scrollbar is counted as an additional item in the surrounding container, suggesting there's more content to explore, even though the scrollbar can't be reached.
  • Menu.GroupLabel is announced as a separate stop even though its text is already announced when focus enters the associated group (via the aria-labelledby relationship), so the same text is heard twice.

The same applies to the group labels in Select and Combobox, and to ScrollArea.Corner.

Changes

Add aria-hidden="true" by default to:

  • Menu.GroupLabel
  • Select.GroupLabel
  • Combobox.GroupLabel (also exported as Autocomplete.GroupLabel)
  • ScrollArea.Scrollbar
  • ScrollArea.Corner

Group labels stay the source of the group's accessible name or description via aria-labelledby/aria-describedby. Hidden text still contributes to a name or description when referenced this way, so the label can be removed as a standalone node without losing the group's name. Scrollbars and the corner remain visually and pointer operable.

Menu.GroupLabel also drops role="presentation". ARIA's presentational roles conflict resolution makes user agents ignore that role once the element carries a global ARIA attribute, and aria-hidden is global, so the role no longer had an effect. Select.GroupLabel and Combobox.GroupLabel never set it, so the three parts now match.

The defaults are applied before user props are spread, so users can still override aria-hidden.

None of these elements are focusable or contain focusable content, so the browser does not warn about aria-hidden.

Closes #5585

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown

commit: f9f17ed

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 29, 2026

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+65B(+0.01%) 🔺+10B(+0.01%)

Details of bundle changes

Performance

Total duration: 1,029.90 ms -35.75 ms(-3.4%) | Renders: 76 (+0) | Paint: 1,651.25 ms -76.30 ms(-4.4%)

No significant changes — details


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

@netlify

netlify Bot commented Aug 29, 2026

Copy link
Copy Markdown

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f9f17ed
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a953423d2c95b00086a7633
😎 Deploy Preview https://deploy-preview-5598--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@atomiks atomiks added accessibility a11y type: bug It doesn't behave as expected. component: menu Changes related to the menu component. component: scroll area Changes related to the scroll area component. component: select Changes related to the select component. component: combobox Changes related to the combobox component. labels Aug 31, 2026
@atomiks atomiks changed the title [menu][scroll area] Hide group labels and scrollbars from the accessibility tree [menu][select][combobox][scroll area] Hide group labels and scrollbars from the accessibility tree Aug 31, 2026
@atomiks
atomiks enabled auto-merge (squash) August 31, 2026 08:00
@atomiks
atomiks merged commit 20cf869 into mui:master Aug 31, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y component: combobox Changes related to the combobox component. component: menu Changes related to the menu component. component: scroll area Changes related to the scroll area component. component: select Changes related to the select component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[menu][scroll area] Hide group labels and scrollbars from the accessibility tree

2 participants