Skip to content

[Autocomplete] hardcoded role="presentation" on noOptionsText container suppresses semantics for some screen readers #48666

Description

@riri020

Summary

The AutocompleteNoOptions container has a hardcoded role="presentation" that cannot be overridden via any public API. Per WAI-ARIA, this role removes implicit semantics from the element and propagates to owned children. Some AT (NVDA,
older JAWS) honour this and do not announce the "no results" text to users.

Steps to reproduce

  1. Render an <Autocomplete> with a noOptionsText prop
  2. Type something that returns no results so the popup opens with no options
  3. Inspect the DOM — the noOptionsText wrapper has role="presentation"
  4. Test with NVDA or older JAWS — the "no options" text is not announced

Current behavior

AutocompleteNoOptions is rendered with a hardcoded role="presentation":

// node_modules/@mui/material/esm/Autocomplete/Autocomplete.js ~line 717
<AutocompleteNoOptions
  className={classes.noOptions}
  ownerState={ownerState}
  role="presentation"   // ← hardcoded, not overridable
  onMouseDown={event => { event.preventDefault(); }}
>
  {noOptionsText}
</AutocompleteNoOptions>

There is no public API to override the container role  noOptionsText only controls the content, and there is no slots.noOptions or equivalent.

Expected behavior

Either:

a) Remove role="presentation" from the container  the <li> element inside a role="listbox" already provides the correct context and does not need the role suppressed, or
b) Expose the container as a configurable slot (slots.noOptions) so consumers can set or remove the role themselves.

Context

- MUI version: 7.3.9
- Tested with: Chrome + NVDA, Safari + VoiceOver
- Related: the Popper slot also ships with a hardcoded role="presentation" in additionalProps, but that one can be overridden by consumers via slotProps.popper since slotProps merges last in mergeSlotProps.



**Search keywords**: 

Metadata

Metadata

Assignees

Labels

accessibilitya11yscope: autocompleteChanges related to the autocomplete. This includes ComboBox.
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions