Make WordPress Core

Changeset 42727


Ignore:
Timestamp:
02/21/2018 11:03:57 PM (9 years ago)
Author:
afercia
Message:

Accessibility: Change the terms "Quick Edit" link to a button.

For better accessibility and semantics, user interface controls that perform an
action should be buttons. Links should exclusively be used for navigation.
See #38677 / [42725].

Fixes #43382.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r42565 r42727  
    456456                        );
    457457                        $actions['inline hide-if-no-js'] = sprintf(
    458                                 '<a href="#" class="editinline aria-button-if-js" aria-label="%s">%s</a>',
     458                                '<button type="button" class="button-link editinline" aria-label="%s" aria-expanded="false">%s</button>',
    459459                                /* translators: %s: taxonomy term name */
    460460                                esc_attr( sprintf( __( 'Quick edit &#8220;%s&#8221; inline' ), $tag->name ) ),
  • trunk/src/wp-admin/js/inline-edit-tax.js

    r42411 r42727  
    3737                t.what = '#'+t.type+'-';
    3838
    39                 $('#the-list').on('click', 'a.editinline', function(){
    40                         inlineEditTax.edit(this);
    41                         return false;
     39                $( '#the-list' ).on( 'click', '.editinline', function() {
     40                        $( this ).attr( 'aria-expanded', 'true' );
     41                        inlineEditTax.edit( this );
    4242                });
    4343
    … …  
    220220
    221221                                                row.hide().fadeIn( 400, function() {
    222                                                         // Move focus back to the Quick Edit link.
    223                                                         row.find( '.editinline' ).focus();
     222                                                        // Move focus back to the Quick Edit button.
     223                                                        row.find( '.editinline' )
     224                                                                .attr( 'aria-expanded', 'false' )
     225                                                                .focus();
    224226                                                        wp.a11y.speak( inlineEditL10n.saved );
    225227                                                });
    … …  
    263265                        id = id.substr( id.lastIndexOf('-') + 1 );
    264266
    265                         // Show the taxonomy row and move focus back to the Quick Edit link.
    266                         $( this.what + id ).show().find( '.editinline' ).focus();
     267                        // Show the taxonomy row and move focus back to the Quick Edit button.
     268                        $( this.what + id ).show().find( '.editinline' )
     269                                .attr( 'aria-expanded', 'false' )
     270                                .focus();
    267271                }
    268272        },
Note: See TracChangeset for help on using the changeset viewer.