Skip to content

[material_ui] Assign SemanticsRole.option to Autocomplete option items #194031

Open

Description

@kevmoo

Autocomplete's option items never get SemanticsRole.option, so on web the options popup is exposed as button children (with aria-current for the highlighted one) rather than option children with aria-selected.

#192971 adds SemanticsRole.listBox / SemanticsRole.option to the framework and engine. It cannot assign option to the items: RawAutocomplete only sees the opaque widget returned by the caller's optionsViewBuilder, and the default item builder lives in material_ui (flutter/packages), which is tested against stable and can't reference the new enum yet.

Follow-up (this issue), in flutter/packages/packages/material_ui:

  • lib/src/autocomplete.dart _AutocompleteOptions: wrap the options view in Semantics(role: SemanticsRole.listBox, container: true, explicitChildNodes: true).
  • lib/src/autocomplete.dart _AutocompleteOptionsList: add role: SemanticsRole.option to the per-item Semantics(button: true, selected: highlight, ...) wrapper (selected: landed in [material_ui] Improve Autocomplete, DrawerHeader, and Tooltip accessibility packages#12918). The web engine resolves the explicit role before the button flag, and the framework's option check only requires a listBox ancestor, so the ListView scroll wrappers between them are fine.
  • lib/src/dropdown_menu.dart: entries are MenuItemButtons inside a MenuAnchor with no listBox container, and DropdownMenu is a combobox pattern, so this needs a design decision (listbox vs. menu popup) rather than a one-liner. Evaluate separately.
  • Re-verify #/auto-complete in packages/material_ui/test_apps/a11y_assessments (Chrome Accessibility.getFullAXTree should show role=listbox > role=option with aria-selected).

Blocked on #192971 shipping in a stable Flutter release; material_ui then needs a min-Flutter bump to that version (cf. #192839 for why it can't reference master-only APIs under the current >=3.47.0 constraint).

Related VPAT: b/464138739, b/460080184. Related: #156371.

Activity

  1. added
    p: material_uimaterial_ui package in flutter/packages
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    platform-webWeb applications specifically
    team-designOwned by Design Languages team
    on Oct 8, 2026
  2. added
    triaged-designTriaged by Design Languages team
    P2Important issues not at the top of the work list
    on Oct 20, 2026
  3. mmohankrishna-lab commented on Nov 2, 2026

    @mmohankrishna-lab

    Status: #192971 merged to master on Oct 13 (b535b37), about 4 hours after the 3.50 beta branched from 0e4dea4. It isn't in 3.50.0-0.3.pre or stable 3.47.9. So this will need the stable release after 3.50, plus a minimum Flutter bump in material_ui (in the same PR, per #192839).

    In the meantime I'll prepare the _AutocompleteOptions (SemanticsRole.listBox) and _AutocompleteOptionsList (SemanticsRole.option) changes and tests against master. I'll open the PR when the minimum can be raised. I'll leave DropdownMenu out of scope, as suggested in the issue description.

  4. mmohankrishna-lab commented on Nov 3, 2026

    @mmohankrishna-lab

    I'd like to pick this up once it's unblocked.

    Status: #192971 merged to master on Oct 13 (b535b37), about 4 hours after the 3.50 beta branched from 0e4dea4. It isn't in 3.50.0-0.3.pre or stable 3.47.9. So this will need the stable release after 3.50, plus a minimum Flutter bump in material_ui (in the same PR, per #192839).

    In the meantime I'll prepare the _AutocompleteOptions (SemanticsRole.listBox) and _AutocompleteOptionsList (SemanticsRole.option) changes and tests against master. I'll open the PR when the minimum can be raised. I'll leave DropdownMenu out of scope, as suggested in the issue description.

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

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)p: material_uimaterial_ui package in flutter/packagesplatform-webWeb applications specificallyteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions