Make WordPress Core


Ignore:
Timestamp:
10/24/2020 03:32:46 AM (4 years ago)
Author:
TimothyBlynJacobs
Message:

App Passwords: Improve accessibility.

  • Make form inputs stacked instead of inline.
  • Provide a visible label for the app name.
  • Add screen reader text to dismiss button.
  • Make "Revoke" button label more descriptive.
  • Use aria-disabled instead of disabled to avoid focus loss.
  • Display password in a readonly input to assist copy and paste.
  • Remove large sections of italic text.
  • Use .form-wrap and .form-field to give consistent form styling.
  • Improve labeling and placeholder text.

Props alexstine, georgestephanis, afercia, TimothyBlynJacobs.
Fixes #51580.

File:
1 edited

Legend:

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

    r49282 r49294  
    740740            }
    741741            ?>
    742         <div class="create-application-password">
    743             <label for="new_application_password_name" class="screen-reader-text"><?php _e( 'New Application Password Name' ); ?></label>
    744             <input type="text" size="30" id="new_application_password_name" name="new_application_password_name" placeholder="<?php esc_attr_e( 'New Application Password Name' ); ?>" class="input" />
     742        <div class="create-application-password form-wrap">
     743            <div class="form-field">
     744                <label for="new_application_password_name"><?php _e( 'New Application Password Name' ); ?></label>
     745                <input type="text" size="30" id="new_application_password_name" name="new_application_password_name" placeholder="<?php esc_attr_e( 'WordPress App on My Phone' ); ?>" class="input" />
     746            </div>
    745747
    746748            <?php
     
    755757            ?>
    756758
    757             <?php submit_button( __( 'Add New' ), 'secondary', 'do_new_application_password', false ); ?>
     759            <?php submit_button( __( 'Add New' ), 'secondary', 'do_new_application_password' ); ?>
    758760        </div>
    759761
     
    857859    <script type="text/html" id="tmpl-new-application-password">
    858860        <div class="notice notice-success is-dismissible new-application-password-notice" role="alert" tabindex="0">
    859             <p>
     861            <p class="application-password-display">
    860862                <?php
    861863                printf(
     
    863865                    esc_html__( 'Your new password for %1$s is: %2$s' ),
    864866                    '<strong>{{ data.name }}</strong>',
    865                     '<kbd>{{ data.password }}</kbd>'
     867                    '<input type="text" class="code" readonly="readonly" value="{{ data.password }}" />'
    866868                );
    867869                ?>
     
    869871            <p><?php esc_attr_e( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ); ?></p>
    870872            <button type="button" class="notice-dismiss">
    871                 <span class="screen-reader-text"><?php __( 'Dismiss this notice.' ); ?></span>
     873                <span class="screen-reader-text"><?php _e( 'Dismiss this notice.' ); ?></span>
    872874            </button>
    873875        </div>
Note: See TracChangeset for help on using the changeset viewer.