Skip to content

Accessibility: add aria-expanded attribute to menu button(s) #54

@adamjohnson

Description

@adamjohnson

Request:

Priority navigation should add aria-expanded to the <button> tag(s)—for both "More" and the breakpoint mobile menu:

What is aria-expanded?

aria-expanded indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.

W3 aria-expanded spec

Current markup:

<button aria-controls="menu" class="nav__dropdown-toggle priority-nav__dropdown-toggle priority-nav-is-visible" prioritynav-count="2">more</button>

Proposed markup:

<button aria-expanded="false" aria-controls="menu" class="nav__dropdown-toggle priority-nav__dropdown-toggle priority-nav-is-visible" prioritynav-count="2">more</button>

aria-expanded is a boolean attribute. When the menu is open, it should toggle to true.

Here's a demo that shows aria-expanded in action in a similar context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions