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