mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Login and Registration: Remove aria-expanded from "Generate Password" button.
During password resets, the 'Generate Password" button has a `aria-expanded="true"` attribute, but the button itself does not expand or collapse anything. This change adds a `skip-aria-expanded` class to the button which is referenced in JavaScript to skip updating the `aria-expanded` attribute on the button itself when clicked. This change also resets the `aria-expanded` attribute to `false` for the parent form after it's submitted. Props alexstine, johnjamesjacoby, sabernhardt. Fixes #54538. git-svn-id: https://develop.svn.wordpress.org/trunk@52450 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -216,7 +216,7 @@
|
||||
updateLock = true;
|
||||
|
||||
// Make sure the password fields are shown.
|
||||
$generateButton.attr( 'aria-expanded', 'true' );
|
||||
$generateButton.not( '.skip-aria-expanded' ).attr( 'aria-expanded', 'true' );
|
||||
$passwordWrapper
|
||||
.show()
|
||||
.addClass( 'is-open' );
|
||||
@@ -257,6 +257,8 @@
|
||||
|
||||
// Stop an empty password from being submitted as a change.
|
||||
$submitButtons.prop( 'disabled', false );
|
||||
|
||||
$generateButton.attr( 'aria-expanded', 'false' );
|
||||
} );
|
||||
|
||||
$pass1Row.closest( 'form' ).on( 'submit', function () {
|
||||
|
||||
@@ -979,7 +979,7 @@ switch ( $action ) {
|
||||
?>
|
||||
<input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
|
||||
<p class="submit reset-pass-submit">
|
||||
<button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="true"><?php _e( 'Generate Password' ); ?></button>
|
||||
<button type="button" class="button wp-generate-pw hide-if-no-js skip-aria-expanded"><?php _e( 'Generate Password' ); ?></button>
|
||||
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Save Password' ); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user