Aria-label missing on autocomplete #6707
Replies: 1 comment 1 reply
|
The warning is for the internal dialog inside Add a title inside the popover so React Aria can associate it with that internal dialog: import { Heading } from "react-aria-components";
<Autocomplete
// The visible <Label> already labels the select; remove the unrelated
// aria-label="Event date", or change it to an employee-related label.
placeholder="Seleziona i dipendenti"
selectionMode="multiple"
// ...the rest of your props
>
<Label>Dipendenti associati al dispositivo</Label>
<Autocomplete.Trigger>
<Autocomplete.Value />
<Autocomplete.ClearButton />
<Autocomplete.Indicator />
</Autocomplete.Trigger>
<Autocomplete.Popover>
<Heading slot="title" className="sr-only">
Seleziona i dipendenti
</Heading>
<Autocomplete.Filter filter={contains}>
{/* SearchField + ListBox */}
</Autocomplete.Filter>
</Autocomplete.Popover>
</Autocomplete>The heading can be visible if that suits the design; So this is not a missing label on your outer modal. It is a current composition gap: |
Uh oh!
There was an error while loading. Please reload this page.
Hi, i have a problem during the rendering of a modal which contains an autocomplete component.
On the console i get
A dialog must have a title for accessibility. Either provide an aria-label or aria-labelledby prop, or render a heading element inside the dialog. I tried to put aria-label tag on Autocomplete but didn't solve the problem.Thank you
All reactions