Make WordPress Core

Opened 6 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#62916 closed defect (bug) (invalid)

Twenty Twenty: aria-controls & aria-expanded attributes missing from primary menu

Reported by: bschneidewind's profile bschneidewind Owned by: joedolson's profile joedolson
Milestone: Priority: normal
Severity: normal Version: 5.3
Component: Bundled Theme Keywords: has-patch
Focuses: accessibility Cc:

Description

On the TwentyTwenty theme, dropdown menus on the primary menu are missing the aria-controls and aria-expanded attributes.

Attachments (2)

before-patch.png (71.2 KB) - added by shailu25 3 weeks ago.
Before Patch
after-patch.png (66.3 KB) - added by shailu25 3 weeks ago.
After Patch

Download all attachments as: .zip

Change History (11)

This ticket was mentioned in PR #8272 on WordPress/wordpress-develop by @bschneidewind.


6 weeks ago
#1

  • Keywords has-patch added

On the TwentyTwenty theme, dropdown menus on the primary menu are missing the aria-controls and aria-expanded attributes.

Trac ticket: https://core.trac.wordpress.org/ticket/62916

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


6 weeks ago

#3 @joedolson
6 weeks ago

  • Milestone changed from Awaiting Review to 6.8
  • Owner set to joedolson
  • Status changed from new to accepted
  • Version set to 5.3

@audrasjb commented on PR #8272:


6 weeks ago
#4

I can confirm the PR addresses the issue.

## Before patch
https://github.com/user-attachments/assets/55f1976c-6cd1-47bb-aae6-3584000b3897

## After patch
https://github.com/user-attachments/assets/e794a5fe-3c84-41bf-832f-dd53366697f6

#5 @shailu25
3 weeks ago

Test Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/8272

Environment:
WordPress - 6.8-alpha-20250207.133319
OS - Windows
Browser - Firefox
Theme: Twenty Twenty
PHP - 8.2.12
Active Plugin: None

Actual Results:

  • Issue Resolved With Patch.✅

Screenshots:

  • Added Attachment

@shailu25
3 weeks ago

Before Patch

@shailu25
3 weeks ago

After Patch

#6 @joedolson
3 weeks ago

It's debatable whether these should actually have aria-expanded attributes. There is no action taken to open or close these menus. From a screen-reader perspective, they aren't actually hidden, and there's no need to disclose them - the navigation is continuous.

aria-expanded is intended to convey the results of an action with a state change; but there's no state change here. The sub menus are only hidden visually, using off-screen positioning similar to screen reader text classes.

In my opinion, not having aria-expanded is correct here, given the behavior.

@afercia Your opinion?

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


3 weeks ago

#8 @joedolson
3 weeks ago

  • Milestone 6.8 deleted
  • Resolution set to invalid
  • Status changed from accepted to closed

Following discussion in the March 4, 2025 accessibility bug scrub, we're closing this, as it's not actually an improvement per the previous comment.

#9 @afercia
3 weeks ago

@joedolson I'd agree that aria-expanded isn't necessary because the menu items don't require activation to show the sub-menus. Instead, the responsive menu provides a separate button to open tue sub-menus and it does use aria-expanded.

Note: See TracTickets for help on using tickets.