Skip to content

Commit 7df26a4

Browse files
Toolbar: Fix ARIA [role] on menu descendants.
Adds a `role="group"` to the WordPress admin bar menu list items to fix the following accessibility issue: {{{ Elements with an ARIA [role] that require children to contain a specific [role] are missing some or all of those required children. }}} Reference: * [https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/group_role ARIA: group role] via mdn web docs Follow-up to [42128], [21193], [19558]. Props heinperu, joedolson, krupajnanda, rajinsharwar, rcreators, sabernhardt. Fixes #60919. git-svn-id: https://develop.svn.wordpress.org/trunk@58438 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 338f47b commit 7df26a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/wp-includes/class-wp-admin-bar.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ final protected function _render_item( $node ) {
575575
$menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"';
576576
}
577577

578-
echo "<li id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$menuclass>";
578+
echo "<li role='group' id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$menuclass>";
579579

580580
if ( $has_link ) {
581581
$attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' );

0 commit comments

Comments
 (0)