WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#32578 closed defect (bug) (fixed)

Admin menu: current item should have an aria-haspopup attribute when folded

Reported by: afercia Owned by: wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.2
Component: Administration Keywords: has-patch commit
Focuses: accessibility, javascript Cc:

Description

See related: #32346

When the admin menu is folded or auto-folded (but not when in responsive view) the current menu item should have an aria-haspopup="true" attribute like all the other menu items since it does have a fly-out sub-menu.
Should probably be set and removed with JavaScript depending on the menu collapsed/expanded status.

With the attribute set, screen readers would correctly announce the menu item has a sub-menu, see screenshot below:

https://cldup.com/XMuS6jwhbK.png

Reference:
http://www.w3.org/TR/wai-aria/states_and_properties#aria-haspopup
aria-haspopup (property)
Indicates that the element has a popup context menu or sub-level menu.

Attachments (2)

32578.patch (1.6 KB) - added by afercia 5 years ago.
32578.2.patch (1.6 KB) - added by afercia 5 years ago.

Download all attachments as: .zip

Change History (11)

@afercia
5 years ago

#1 @afercia
5 years ago

  • Keywords has-patch dev-feedback added

First pass. Tries to detect when the menu is folded or auto-folded. Since the auto-fold CSS class on the body doesn't get removed in some cases, tries to detect when window.innerWidth is in the range > 782 and <= 960. Would greatly appreciate some leads/committers JavaScript feedback.

#2 @afercia
5 years ago

  • Owner set to afercia
  • Status changed from new to assigned

#3 @afercia
5 years ago

  • Milestone changed from Awaiting Review to 4.4

To recap:

  • currently, when the admin menu is expanded, the menu items with sub-items have an aria-haspopup=true attribute except the current active menu item which is displayed open and that's correct
  • by the way, when the admin menu is collapsed, also the current active menu item (with sub-items) should have an aria-haspopup=true attribute

This ticket was mentioned in Slack in #core by afercia. View the logs.


5 years ago

#5 @afercia
5 years ago

  • Keywords commit added; dev-feedback removed

@afercia
5 years ago

#6 @afercia
5 years ago

Refreshed patch.

This ticket was mentioned in Slack in #core by afercia. View the logs.


5 years ago

#8 @afercia
5 years ago

  • Owner changed from afercia to wonderboymusic

Assigning to @wonderboymusic as per Slack conversation (see above).

#9 @wonderboymusic
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35313:

Administration: the current admin menu item should have an aria-haspopup attribute when the menu is folded.

Unify the jQuery selector caching for window, document, and body.

Props afercia.
Fixes #32578.

Note: See TracTickets for help on using tickets.