From 79929a2ea2f5afac7ca4c871edb9e0b0b43dce52 Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Wed, 15 Jul 2026 10:36:28 +0530 Subject: [PATCH 1/2] Fix: focus password field on reset form only --- src/js/_enqueues/admin/user-profile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js index 5614078bb584a..c2b65bbe058bc 100644 --- a/src/js/_enqueues/admin/user-profile.js +++ b/src/js/_enqueues/admin/user-profile.js @@ -60,8 +60,8 @@ // Once zxcvbn loads, passwords strength is known. $( '#pw-weak-text-label' ).text( __( 'Confirm use of weak password' ) ); - // Focus the password field if not the install screen. - if ( 'mailserver_pass' !== $pass1.prop('id' ) && ! $('#weblog_title').length ) { + // Only focus the password field on the reset password form. + if ( $pass1.closest( '#resetpassform' ).length ) { $( $pass1 ).trigger( 'focus' ); } } From f455da4aed0745a4a5692028c5e6bb4f10f62a6a Mon Sep 17 00:00:00 2001 From: Deepak Kumar Date: Thu, 16 Jul 2026 11:06:18 +0530 Subject: [PATCH 2/2] Users: Avoid forcing initial focus on the password field --- src/js/_enqueues/admin/user-profile.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/js/_enqueues/admin/user-profile.js b/src/js/_enqueues/admin/user-profile.js index c2b65bbe058bc..fb88ee3260989 100644 --- a/src/js/_enqueues/admin/user-profile.js +++ b/src/js/_enqueues/admin/user-profile.js @@ -59,11 +59,6 @@ // Once zxcvbn loads, passwords strength is known. $( '#pw-weak-text-label' ).text( __( 'Confirm use of weak password' ) ); - - // Only focus the password field on the reset password form. - if ( $pass1.closest( '#resetpassform' ).length ) { - $( $pass1 ).trigger( 'focus' ); - } } function bindPass1() {