WordPress.org

Make WordPress Core

Opened 6 years ago

Last modified 6 months ago

#30023 new defect (bug)

Chrome autofill password keeps showing after wp_attempt_focus clears password field

Reported by: Robbert S Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.0
Component: Login and Registration Keywords: 2nd-opinion
Focuses: ui, javascript Cc:

Description

Chrome's autofill of remembered passwords causes an issue with wp_attempt_focus (defined in wp-login.php). The JavaScript function clears the password field, but Chrome still displays the field as filled out.

Submitting the form results in the following error (obviously):

  • ERROR: The password field is empty.

If people want to have Chrome autofill their password, I strongly suggest not to intervene. Not only are we going to annoy users by trying to hack around it (see ticket 24364), but the hacks will also likely cause even more issues in a future Chrome release.

Change History (7)

#1 @joedolson
6 years ago

  • Focuses accessibility removed

#2 @helen
5 years ago

  • Keywords reporter-feedback added

Sorry you never got a response here - is this still an issue? I may be misunderstanding the function as I'm reading it, but it looks like it should only clear on a failed login attempt. It also seems buggy for Chrome to show the field as non-empty when it is empty.

#3 @afercia
5 years ago

Yep, seems Chrome is a bit buggy here, see for example: https://code.google.com/p/chromium/issues/detail?id=378419

It's still an issue after a failed login attempt: Chrome will display the password field filled with "dots" while it's actually empty.

By the way, wondering why wp_attempt_focus() should try to empty the fields in the first place. Wouldn't be enough to focus and select them?

#4 @swissspidy
4 years ago

  • Keywords reporter-feedback removed
  • Milestone changed from Awaiting Review to Future Release

This annoys me every time I try to log into a WordPress site.

Apparently for Chrome it's a wontfix, but since WordPress is causing this issue, I think we should to something about it.

#5 @afercia
3 years ago

See also #40301.

#6 @ocean90
3 years ago

#41754 was marked as a duplicate.

#7 @bookdude13
6 months ago

  • Keywords 2nd-opinion added

Testing this with Chrome and Firefox, the attempt to clear the password field doesn't always work with browser autocomplete, but it does when an incorrect or empty password is entered. However, even in this case the focus stays on the password input, not going to the username input.

What was the original intent for the clearing of the password input? My suggestion would be to remove the call if it's not working and causing problems with autocomplete.

More info:

Test Chrome Firefox
Normal login User autofill, password autofill, wp_attempt_focus not in page source User autofill, password autofill, wp_attempt_focus in page source
Invalid username User not autofill, password autofill, wp_attempt_focus not in page source User not autofill, password autofill, wp_attempt_focus in page source
Invalid password User autofill, password autofill then cleared, wp_attempt_focus in page source User autofill, password autofill then cleared, wp_attempt_focus not in page source
Empty user User autofill, password autofill, wp_attempt_focus not in page source User autofill, password autofill, wp_attempt_focus in page source
Empty password User autofill, password autofill then cleared, wp_attempt_focus in page source User autofill, password autofill then cleared, wp_attempt_focus not in page source
Empty user and password User autofill, password autofill, wp_attempt_focus not in page source User autofill, password autofill then cleared, wp_attempt_focus in page source
Note: See TracTickets for help on using tickets.