Knowledgebase

Building Accessible Menus and Selects Print

  • frontenddevelopment, frontend, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Disclosure components.

WHAT THEY MUST DO

Indicate their expanded state Open and close by keyboard Allow arrow key navigation between items Close on escape, returning focus to the trigger Announce their nature and state

WHAT DISTINGUISHES A MENU FROM A LIST OF LINKS

A menu contains actions and has specific keyboard expectations.

WHY THAT MATTERS

Marking navigation as a menu creates expectations the implementation must meet.

WHAT TO USE FOR SIMPLE SELECTION

The native select element.

WHY

It is accessible, works on every device, and provides the native mobile picker.

WHEN A CUSTOM ONE IS WARRANTED

Searching within many options Selecting several Rich content within options

WHAT TO USE THEN

An established accessible library.

WHAT TO BE CAREFUL WITH

Opening on hover, which excludes touch Closing when focus moves within the component Options extending beyond the screen

WHAT TO TEST

Operating it entirely by keyboard, and on a touch device.

WHAT TO PROVIDE

A visible focus indicator on the active option.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot