Login and Registration: auto-focus the reset password field.

Although auto-focusing form fields can be arguable in some cases, it makes sense when there is a very specific task to accomplish and when there is no relevant content before the auto-focused field.

This change brings consistency between various forms generated by `wp-login.php`.

Props afercia, donmhico, sabernhardt.
Fixes #40302.


git-svn-id: https://develop.svn.wordpress.org/trunk@52193 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras 2021-11-17 00:12:35 +00:00
parent c1089ebc68
commit 6679a0614d
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,9 @@
// Once zxcvbn loads, passwords strength is known.
$( '#pw-weak-text-label' ).text( __( 'Confirm use of weak password' ) );
// Focus the password field.
$( $pass1 ).trigger( 'focus' );
}
function bindPass1() {

View File

@ -992,7 +992,7 @@ switch ( $action ) {
</p>
<?php
login_footer( 'user_pass' );
login_footer( 'pass1' );
break;
case 'register':