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.
Built from https://develop.svn.wordpress.org/trunk@60268


git-svn-id: http://core.svn.wordpress.org/trunk@59604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson
2025-05-30 16:37:48 +00:00
parent 09758ea71f
commit 369d812d23
3 changed files with 4 additions and 4 deletions

View File

@@ -56,8 +56,8 @@
// Once zxcvbn loads, passwords strength is known.
$( '#pw-weak-text-label' ).text( __( 'Confirm use of weak password' ) );
// Focus the password field.
if ( 'mailserver_pass' !== $pass1.prop('id' ) ) {
// Focus the password field if not the install screen.
if ( 'mailserver_pass' !== $pass1.prop('id' ) && ! $('#weblog_title').length ) {
$( $pass1 ).trigger( 'focus' );
}
}

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60267';
$wp_version = '6.9-alpha-60268';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.