feat(a11y/combosearch): add aria-ownws props
However it may be redundant due to aria-controls presence. Cf #8643
This commit is contained in:
parent
07579c9a58
commit
acffd45a22
1 changed files with 3 additions and 1 deletions
|
@ -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) => {
|
||||||
|
|
Loading…
Reference in a new issue