Make WordPress Core


Ignore:
Timestamp:
10/10/2016 04:23:23 PM (8 years ago)
Author:
afercia
Message:

Accessibility: Improve the UI controls to move the Menu items.

On the Menus screen, the links to move menu items behave like buttons: they
perform an action so they should be real buttons to be correctly reported to
assistive technologies. Since they're logically grouped controls, they should
also be wrapped in a <fieldset> element for better semantics and accessibility.

Props Cheffheid.
Fixes #35578.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php

    r37953 r38770  
    198198                </p>
    199199
    200                 <p class="field-move hide-if-no-js description description-wide">
    201                     <label>
    202                         <span><?php _e( 'Move' ); ?></span>
    203                         <a href="#" class="menus-move menus-move-up" data-dir="up"><?php _e( 'Up one' ); ?></a>
    204                         <a href="#" class="menus-move menus-move-down" data-dir="down"><?php _e( 'Down one' ); ?></a>
    205                         <a href="#" class="menus-move menus-move-left" data-dir="left"></a>
    206                         <a href="#" class="menus-move menus-move-right" data-dir="right"></a>
    207                         <a href="#" class="menus-move menus-move-top" data-dir="top"><?php _e( 'To the top' ); ?></a>
    208                     </label>
    209                 </p>
     200                <fieldset class="field-move hide-if-no-js description description-wide">
     201                    <span class="field-move-visual-label" aria-hidden="true"><?php _e( 'Move' ); ?></span>
     202                    <button type="button" class="button-link menus-move menus-move-up" data-dir="up"><?php _e( 'Up one' ); ?></button>
     203                    <button type="button" class="button-link menus-move menus-move-down" data-dir="down"><?php _e( 'Down one' ); ?></button>
     204                    <button type="button" class="button-link menus-move menus-move-left" data-dir="left"></button>
     205                    <button type="button" class="button-link menus-move menus-move-right" data-dir="right"></button>
     206                    <button type="button" class="button-link menus-move menus-move-top" data-dir="top"><?php _e( 'To the top' ); ?></button>
     207                </fieldset>
    210208
    211209                <div class="menu-item-actions description-wide submitbox">
Note: See TracChangeset for help on using the changeset viewer.