Skip to content

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

Closed

Description

@ciampo

Bug report

Current behavior

When grid is enabled on Autocomplete.Root or Combobox.Root, the list is rendered with both role="grid" and aria-orientation="horizontal":

<div role="grid" aria-orientation="horizontal">

aria-orientation is not supported by the grid role. Axe reports an
aria-allowed-attr violation: “Elements must only use supported ARIA
attributes.”

The attribute comes from the internal navigation configuration rather than a consumer prop:

  • AriaCombobox passes orientation: grid ? 'horizontal' : undefined to useListNavigation.
  • useListNavigation exposes any orientation other than both as aria-orientation.
  • ComboboxList applies those props to the element rendered with role="grid".

The keyboard navigation works, but the resulting ARIA is invalid. WAI-ARIA requires user agents to ignore non-global properties on roles that do not support them.

Expected behavior

Grid mode should keep its internal horizontal navigation setting for ArrowLeft and ArrowRight handling, but it should not render aria-orientation on the role="grid" element.

Reproducible example

The issue reproduces in the official Autocomplete Grid layout example:

  1. Open the emoji picker.
  2. Inspect the element rendered by Autocomplete.List.
  3. Observe role="grid" together with aria-orientation="horizontal".
  4. Run Axe and observe the aria-allowed-attr violation.

The minimal component structure is:

<Autocomplete.Root items={items} grid>
  <Autocomplete.Input aria-label="Search" />
  <Autocomplete.List>
    {/* Autocomplete.Row and Autocomplete.Item elements */}
  </Autocomplete.List>
</Autocomplete.Root>

Base UI version

v1.7.0. The same implementation is present on master at commit 838b0848f823dc37a36da0d8e325b5a733ab1670.

Which browser are you using?

Chrome 151.0.7922.140. The invalid attribute is generated independently of the browser.

Which OS are you using?

macOS 26.6.2.

Which assistive tech are you using (if applicable)?

Not applicable. Detected with axe-core 4.10.2.

Additional context

The WAI-ARIA 1.2 grid role does not list aria-orientation among its supported or inherited properties. Its state and property processing requirements require user agents to ignore non-global properties on roles that do not support them.

This appears similar to previously fixed Base UI issues where orientation was needed internally for keyboard behavior but was invalid on the rendered role:

A component-level fix could strip the generated DOM attribute when grid is true without changing the navigation hook's orientation setting. A regression test should assert that grid-mode Autocomplete and Combobox lists do not have aria-orientation and that two-dimensional arrow-key navigation still works.

Activity

  1. github-actions commented on Aug 24, 2026

    @github-actions

    This fix will be available in the next npm release of Base UI.

    In the meantime, use the canary build from PR #5551:

    npm i https://pkg.pr.new/@base-ui/react@25c5bae

    This installs a complete package for @base-ui/react with the fix included. It is hosted by pkg.pr.new rather than npm, and the URL is available for up to six months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: autocompleteChanges related to the autocomplete component.component: comboboxChanges related to the combobox component.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions