Make WordPress Core

Changeset 60268


Ignore:
Timestamp:
05/30/2025 04:34:23 PM (7 weeks ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/user-profile.js

    r59046 r60268  
    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        }
Note: See TracChangeset for help on using the changeset viewer.