Course contentsShow
← Web Development
Lesson 1174 of 2,98221. Accessible ComponentsFree lesson

Common Dropdown Accessibility Mistakes

Avoiding div-based menus, improper ARIA usage, and focus traps in dropdown implementations.

Common Dropdown Accessibility Mistakes

You'll learn: The most frequent accessibility pitfalls developers encounter when building dropdowns, and how to avoid them.

The Challenge

After learning proper dropdown patterns, it's crucial to recognize what not to do. Many accessible-looking dropdowns fail users because of subtle but critical mistakes that break keyboard navigation, screen reader support, or focus management.

Three Major Mistakes

1. Using <div> Elements for Menus

Building a dropdown entirely with <div> elements and styling them like buttons/menus creates a "fake" widget. Without proper roles (button, menu, menuitem), screen readers announce it as generic content. Users can't identify it as interactive or navigate it properly.

Analogy: It's like painting a door on a wall—it looks right visually, but you can't actually open it.

2. Improper ARIA Usage

Common errors include:

  • Using aria-expanded without a proper button role
  • Adding role="menu" to navigation links (should be regular links)
  • Forgetting aria-haspopup="true" on trigger buttons
  • Mixing incompatible roles (like <button role="menuitem">)

Remember: ARIA doesn't add behavior—it only communicates semantics. Wrong ARIA creates confusion without fixing underlying problems.

3. Focus Traps That Don't Release

Implementing focus trapping in a dropdown but forgetting Escape key handling or click-outside behavior leaves keyboard users stuck. Always ensure multiple exit paths: Escape key, Tab to exit, and selection/activation.

Prevention Strategy

Test every dropdown with keyboard only (no mouse) and with a screen reader. If you can't navigate it smoothly both ways, users can't either.

Key Takeaway: Avoid <div>-based menus without proper semantics, don't misuse ARIA as a band-aid for poor HTML, and always provide multiple ways to exit focus-trapped dropdowns—these three mistakes account for most dropdown accessibility failures.