feat(a11y/combosearch): add aria-ownws props

However it may be redundant due to aria-controls presence.

Cf #8643
This commit is contained in:
Colin Darie 2023-02-22 11:49:26 +01:00
parent 07579c9a58
commit acffd45a22
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -158,6 +158,7 @@ function ComboSearch<Result>({
}, [results.length, isSuccess]);
const initInstrId = useId();
const resultsId = useId();
return (
<Combobox onSelect={handleOnSelect}>
@ -169,9 +170,10 @@ function ComboSearch<Result>({
autocomplete={false}
id={id}
aria-describedby={describedby ?? initInstrId}
aria-owns={resultsId}
/>
{isSuccess && (
<ComboboxPopover className="shadow-popup">
<ComboboxPopover id={resultsId} className="shadow-popup">
{results.length > 0 ? (
<ComboboxList>
{results.map((result, index) => {