Skip to content

[combobox][menu][select] Move aria-orientation to the role owners - #5551

Merged
atomiks merged 5 commits into
mui:masterfrom
gonzoblasco:fix/remove-invalid-aria-orientation-grid
Aug 24, 2026
Merged

atomiks merged 5 commits into
mui:masterfrom
gonzoblasco:fix/remove-invalid-aria-orientation-grid

Conversation

@gonzoblasco

@gonzoblasco gonzoblasco commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #5548

Grid Combobox and Autocomplete lists rendered aria-orientation="horizontal", but the grid role does not support that property. The navigation hook still needs a horizontal orientation to implement two-dimensional keyboard movement, so role-specific ARIA now belongs to the components that assign the final role.

Changes

  • Stop useListNavigation from emitting aria-orientation.
  • Set orientation on Menu, Select, and non-grid Combobox role owners; omit it from grid and presentation roles.
  • Preserve horizontal and vertical grid navigation.
  • Add regression coverage for the generic hook and each affected public component.

The grid role does not support aria-orientation (axe: aria-allowed-attr),
but AriaCombobox passed orientation:'horizontal' to useListNavigation when
grid was enabled, rendering aria-orientation='horizontal' on the grid.
Autocomplete reuses AriaCombobox, so both were affected.

Don't pass orientation when grid is active; grid navigation is handled by
gridNavigation. Add a test asserting the grid has no aria-orientation.
@pkg-pr-new

pkg-pr-new Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

commit: 25c5bae

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react ▼-9B(0.00%) ▼-6B(0.00%)

Details of bundle changes

Performance

Total duration: 988.29 ms +8.48 ms(+0.9%) | Renders: 76 (+0) | Paint: 1,588.86 ms -22.51 ms(-1.4%)

No significant changes — details


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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1aa0f97591

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@netlify

netlify Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 25c5bae
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a8bfd664282260008319a8d
😎 Deploy Preview https://deploy-preview-5551--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.

Preserve orientation:'horizontal' for grid navigation (horizontal arrow
keys) but strip the resulting aria-orientation attribute from the list
props, since the grid role does not support it (axe: aria-allowed-attr).
@gonzoblasco

Copy link
Copy Markdown
Contributor Author

Addressed. I kept orientation: 'horizontal' for the grid navigation (horizontal arrow keys still work) and instead strip the resulting aria-orientation attribute from the composed listProps when grid is active, so the invalid attribute no longer renders on role="grid" while navigation is preserved.

@zannager zannager added the component: combobox Changes related to the combobox component. label Aug 21, 2026
@atomiks atomiks changed the title [combobox] Remove invalid aria-orientation from grid role [combobox][menu][select] Move aria-orientation to the role owners Aug 24, 2026
@atomiks
atomiks merged commit a868c5a into mui:master Aug 24, 2026
24 checks passed
@michaldudak michaldudak added component: menu Changes related to the menu component. component: select Changes related to the select component. labels Sep 1, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: combobox Changes related to the combobox component. component: menu Changes related to the menu component. component: select Changes related to the select component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[autocomplete][combobox] Grid renders invalid aria-orientation

4 participants