accessibility: make dropdowns accessible (#9475)

#### Motivation

Improve accessibility of dropdowns.

#### Before

Dropdowns are not accessible.

<img width="1219" alt="Screenshot 2025-01-09 at 10 00 36"
src="https://github.com/user-attachments/assets/060198f8-a42f-408c-a39a-b83da55e23c4"
/>

#### Ater

Dropdowns are accessible


![image](https://github.com/user-attachments/assets/e46d6292-913c-458b-acd4-37ed4e1a1e9b)
This commit is contained in:
Malo Marrec
2025-01-09 14:19:58 +01:00
committed by GitHub
parent e62079ab6d
commit 7126ec5ae7
7 changed files with 23 additions and 1 deletions

View File

@ -136,6 +136,10 @@ export const Dropdown = ({
<div
ref={refs.setReference}
onClick={handleClickableComponentClick}
aria-controls={`${dropdownId}-options`}
aria-expanded={isDropdownOpen}
aria-haspopup={true}
role="button"
>
{clickableComponent}
</div>