Skip to content

Commit 064682f

Browse files
committed
Upgrade/Install: Avoid setting focus on password during install.
On the installation screen, focus was set first to the site title field, then moved to the password field. Autofocus should only ever be moved to the first field of a form, so that screen reader users don't miss important fields. Fix by checking whether the site title field is present before setting password field focus. Props zodiac1978, himanshupathak95, abcd95, joedolson. Fixes #63281. git-svn-id: https://develop.svn.wordpress.org/trunk@60268 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7fdef4e commit 064682f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/_enqueues/admin/user-profile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
// Once zxcvbn loads, passwords strength is known.
5757
$( '#pw-weak-text-label' ).text( __( 'Confirm use of weak password' ) );
5858

59-
// Focus the password field.
60-
if ( 'mailserver_pass' !== $pass1.prop('id' ) ) {
59+
// Focus the password field if not the install screen.
60+
if ( 'mailserver_pass' !== $pass1.prop('id' ) && ! $('#weblog_title').length ) {
6161
$( $pass1 ).trigger( 'focus' );
6262
}
6363
}

0 commit comments

Comments
 (0)