WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/17/2016 03:40:50 PM (4 years ago)
Author:
afercia
Message:

Accessibility: Customizer, improve UI controls in customize.php

  • makes the mobile preview/customize toggle a button
  • changes the "Close" link hidden text from 'Cancel' to 'Close the Customizer and go back to the previous page'
  • adds a missing type="button" attribute
  • removes unnecessary keydown events and preventDefault(): buttons don't need a keydown event and when they have a type="button" attribute there's no default action to prevent

Props Cheffheid, afercia.

Fixes #31487.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r37197 r37230  
    119119            ?>
    120120            <span class="spinner"></span>
    121             <a class="customize-controls-preview-toggle" href="#">
     121            <button type="button" class="customize-controls-preview-toggle">
    122122                <span class="controls"><?php _e( 'Customize' ); ?></span>
    123123                <span class="preview"><?php _e( 'Preview' ); ?></span>
    124             </a>
     124            </button>
    125125            <a class="customize-controls-close" href="<?php echo esc_url( $wp_customize->get_return_url() ); ?>">
    126                 <span class="screen-reader-text"><?php _e( 'Cancel' ); ?></span>
     126                <span class="screen-reader-text"><?php _e( 'Close the Customizer and go back to the previous page' ); ?></span>
    127127            </a>
    128128        </div>
     
    135135                        echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name' ) . '</strong>' );
    136136                    ?></span>
    137                     <button class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
     137                    <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
    138138                </div>
    139139                <div class="customize-panel-description"><?php
Note: See TracChangeset for help on using the changeset viewer.