Skip to content

Commit 9f5df5d

Browse files
committed
Admin menu: improve accessibility when collapsed.
Props afercia. Fixes #32346. git-svn-id: https://develop.svn.wordpress.org/trunk@32946 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 53bc964 commit 9f5df5d

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/wp-admin/css/admin-menu.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,15 @@
318318
padding: 0;
319319
}
320320

321-
#adminmenu .wp-submenu-head,
322-
.folded #adminmenu .wp-menu-name {
321+
#adminmenu .wp-submenu-head {
323322
display: none;
324323
}
325324

325+
.folded #adminmenu .wp-menu-name {
326+
position: absolute;
327+
left: -999px;
328+
}
329+
326330
.folded #adminmenu .wp-submenu-head {
327331
display: block;
328332
}
@@ -678,7 +682,8 @@ li#wp-admin-bar-menu-toggle {
678682
}
679683

680684
.auto-fold #adminmenu .wp-menu-name {
681-
display: none;
685+
position: absolute;
686+
left: -999px;
682687
}
683688

684689
.auto-fold #adminmenu .wp-submenu-head {
@@ -797,7 +802,7 @@ li#wp-admin-bar-menu-toggle {
797802

798803
/* Restore the menu names */
799804
.auto-fold #adminmenu .wp-menu-name {
800-
display: block;
805+
position: static;
801806
margin-left: 35px;
802807
}
803808

src/wp-admin/menu-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
157157

158158
if ( ! empty( $submenu_items ) ) {
159159
echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>";
160-
echo "<li class='wp-submenu-head'>{$item[0]}</li>";
160+
echo "<li class='wp-submenu-head' aria-hidden='true'>{$item[0]}</li>";
161161

162162
$first = true;
163163

0 commit comments

Comments
 (0)