Skip to content

Dropdown

What component has

When dropdown is closed, the focus returns to the trigger.

Keyboard support

Keyboard support
KeyFunction
TabMoves focus to the next focusable element.
Shift + TabMoves focus to the previous focusable element.
Space , EnterActivates the selected item or control.
EscCloses the dropdown.

See detailed information for the controlling dropdown with the keyboard in the Keyboard control guide.

Roles & attributes

The list below describes roles and attributes that component already has.

Roles and attributes
RoleAttributeElementUsage
comboboxdivThe combobox role identifies an element as an input that controls another element, such as a listbox or grid , that can dynamically pop up to help the user set the value of that input.
aria-labeldivThe aria-label attribute defines a string value that labels an interactive element.
tabIndexdivMakes the trigger focusable and includes it in the page Tab sequence. This approach to managing focus is described in the section on roving tabindex.

Other recommendations

See more accessibility recommendations in the common Accessibility guide.

Automated screen reader testing

Intergalactic v15.29.0, React v18.2.0, Playwright v1.25.1, Guidepup v0.13.1, MacOS Monterey 12.

Running screen reader against this file.

1. Screen reader goes into the active element.
2. Screen reader says "Trigger menu pop up button".
3. Screen reader presses the "Control+Option+Space" button.
4. Screen reader presses the "Tab" button.
5. Screen reader says "Content group".
6. Screen reader goes to the next element.
7. Screen reader says "Content  clickable".
8. Screen reader presses the "Escape" button.
9. Screen reader says "Trigger group".
1. Screen reader goes into the active element.
2. Screen reader says "Trigger menu pop up button".
3. Screen reader presses the "Control+Option+Space" button.
4. Screen reader presses the "Tab" button.
5. Screen reader says "Content group".
6. Screen reader goes to the next element.
7. Screen reader says "Content  clickable".
8. Screen reader presses the "Escape" button.
9. Screen reader says "Trigger group".

Released under the MIT License.

Released under the MIT License.