WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#14031 closed defect (bug) (fixed)

Login form JavaScript focus unsets browser saved credentials

Reported by: TheDeadMedic Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0.1
Component: UI Keywords: has-patch needs-testing
Focuses: Cc:

Description

JavaScript function wp_attempt_focus empties out username form
input, not accounting for users that have used a web browser's 'save user/password' feature.

Affects Firefox 3.6.3 - other browsers not tested.

Attachments (3)

14031.diff (616 bytes) - added by wojtek.szkutnik 4 years ago.
14031.2.diff (543 bytes) - added by johnpbloch 3 years ago.
Always keep focus on the name
14031.3.diff (543 bytes) - added by JohnPBloch 3 years ago.
Fix logic

Download all attachments as: .zip

Change History (15)

comment:1 wojtek.szkutnik4 years ago

  • Cc wojtek.szkutnik@… added
  • Keywords gsoc added

wojtek.szkutnik4 years ago

comment:2 wojtek.szkutnik4 years ago

  • Keywords has-patch needs-testing added

Problem confirmed. Patch submitted.

My solution is:
if username memorized by wp -> focus on the password field
if invalid username -> clear the username field, focus on it
else if username autocompleted -> focus on the submit button

I tested it and works well

comment:3 hakre4 years ago

I like that approach, makes sense to me. Nice fix.

comment:4 TheDeadMedic4 years ago

Any updates on this? I know it's minor, but it is irritating!

comment:5 stevejohnson4 years ago

Agreed - this is damn annoying. I administer quite a few different WP sites and my only saving grace is Firefox's saved password feature. The saved password still works - but only if I REMEMBER the username I'm trying to log in as.

And yes, it's too time-consuming to look up usernames for every one of the 100+ installs I take care of.

comment:6 hakre4 years ago

Yeah this would save those who support other users with their wordpress setups a lot as the login names can now differ and the auto-complete dropdown can grow very large now.

comment:7 stevejohnson4 years ago

  • Cc sj@… added
  • Version changed from 3.0 to 3.0.1

IMHO, a fix for this should go in the next release. Two other tickets that I know of have been submitted on this same problem - #14455 and #14866

comment:8 nacin4 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:9 johnpbloch3 years ago

I don't think it's such a good solution to change focus to the submit button. Most people will not notice that the focus is on the button. Instead of being annoyed that they have to type their name in again, they will be annoyed that they have to use the mouse to click submit. I see no reason to change focus away from one of the two fields.

johnpbloch3 years ago

Always keep focus on the name

JohnPBloch3 years ago

Fix logic

comment:10 nacin3 years ago

  • Keywords gsoc removed

Latest patch looks good.

comment:11 nacin3 years ago

I'm also going to add a d.select() here. If you have a username already that's filled in by the browser, putting the cursor at the end is useless. Selecting it allows you to type over both fields and hit login, or just hit enter to log in.

comment:12 nacin3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16870]) Don't clear saved username in wp_attempt_focus. props JohnPBloch, wojtek.szkutnik. fixes #14031.

Note: See TracTickets for help on using tickets.