Form field focus should not be set if user has begun entering text.

Bug #24398 reported by Kevin Krumwiede
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Unknown
firefox (Ubuntu)
Confirmed
Wishlist
Mozilla Bugs

Bug Description

After loading a page containing a form, Firefox automatically focuses the first
input field in the tab order. It should not do this if the user has already
begun entering data into the form. Not only is the current behavior annoying,
but it is a potential security issue. I have often typed passwords into
plaintext fields because Firefox changed the field focus after a slow page load.

If the event handling isn't too messy, it should also not change the input focus
if the user is typing something in the address bar or search bar.

Revision history for this message
In , Ian-hixie (ian-hixie) wrote :

It's not really Mozilla's fault -- the page is specifically focussing the field
when the page has finished loading.

Not sure what we can do about this. There are plenty of legitimate cases
undistinguishable from this one.

Revision history for this message
In , Relf (relf) wrote :

But is it possible not change focus if the user took control over it during page
loading?
Or at least make this feature optional?

Revision history for this message
In , Ian-hixie (ian-hixie) wrote :

We could make .focus() one of the optional features, I guess.

Revision history for this message
In , Emaldonadog (emaldonadog) wrote :

I see another variant:

I load many pages simultanealy (?) in some tab diferents.

If the pages do ....focus(), when I'm writing in the first, I see me with de
focus in the second o the thirth.

Is it possible (uf, my English, I'm sorry) if one page in a tab in background
set the focus, set the focus for this tab, but not for all navigator?

I try to see: I'm in my tab, when I writing, but if I switch to the another tab,
the focus is in the selected tab.

Regards. Eduardo.

Revision history for this message
Kevin Krumwiede (kjkrum) wrote :

After loading a page containing a form, Firefox automatically focuses the first
input field in the tab order. It should not do this if the user has already
begun entering data into the form. Not only is the current behavior annoying,
but it is a potential security issue. I have often typed passwords into
plaintext fields because Firefox changed the field focus after a slow page load.

If the event handling isn't too messy, it should also not change the input focus
if the user is typing something in the address bar or search bar.

Revision history for this message
David Farning (dfarning) wrote :

Do you have an example page where I can confirm this behavior?

Revision history for this message
Kevin Krumwiede (kjkrum) wrote :

I have encountered this most frequently at http://mail.yahoo.com. I tried to
reproduce it using a php script with an intentional delay, but couldn't
duplicate it. Maybe it's an issue of JavaScript changing the input focus in an
untimely manner.

Revision history for this message
David Farning (dfarning) wrote :

Testing with firefox 1.0.7, I can confirm Kevin's bug report. The bug also
exist in upstream 1.0.7. Opened as
https://bugzilla.mozilla.org/show_bug.cgi?id=314154

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

*** Bug 314590 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

*** Bug 263129 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Dtownsend (dtownsend) wrote :

*** Bug 314154 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jruderman (jruderman) wrote :

*** Bug 328770 has been marked as a duplicate of this bug. ***

Revision history for this message
Rocco Stanzione (trappist) wrote :

Happens when a javascript .focus() is called for onload. Even google does it. I'm similarly annoyed by this. It's the designed-in behavior, and the proposed solution upstream is to make .focus() a configurable item, so I'm setting this as a wishlist item.

Changed in firefox:
status: Unconfirmed → Confirmed
Ian Jackson (ijackson)
Changed in firefox:
assignee: ijackson → nobody
Changed in firefox:
status: Unknown → Rejected
Changed in firefox:
assignee: nobody → mozilla-bugs
Revision history for this message
Wouter Stomp (wouterstomp-deactivatedaccount) wrote :

Does this still occur on newer version of firefox?

Revision history for this message
Opoho (opoho) wrote :

Form field focus should also not be set if user has begun entering text in the search bar...

I'm on Firefox Beta 4 (on Windows, sorry) and I find it very annoying... I'll check it with Hardy as soon as I can.

Revision history for this message
John Vivirito (gnomefreak) wrote :

Fixed upstream bug link to the master report at this time.

Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
Opoho (opoho) wrote :

I can now confirm the annoyance in Firefox Beta 5 on stable Hardy.

Test :
1. launch a new page with a search box like http://start.ubuntu.com/8.04/
2. start entering text in the search bar
3. focus is stolen and eventually part of your input lands in the webpage search box

It's mostly a problem on slow connections.

Revision history for this message
In , Jruderman (jruderman) wrote :

*** Bug 437972 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jruderman (jruderman) wrote :

*** Bug 479494 has been marked as a duplicate of this bug. ***

Changed in firefox:
importance: Unknown → Wishlist
Revision history for this message
In , Jdawiseman (jdawiseman) wrote :

When loading my webmail page, godaddy has a few large images. Very stupid of godaddy.

So the HTML loads, I start tying name and password, and partway through the password the page finishes loading and Firefox moves the focus back to the name field. So some of my password is then typed into the name field. Yikes!

Please, never allow a change focus whilst the user is typing. Never, even if the page tries to do this when loading finishes.

Or, as the initial poster in this old bug suggests, don’t change focus if the user has done so.

Thank you.

Revision history for this message
In , Mounir (mounir) wrote :

Webpages should use autofocus instead of |.focus()|. That would solve this issue. Though, I don't know if we should block |.focus()|, I fear that could break some websites.

Revision history for this message
In , Jdawiseman (jdawiseman) wrote :

It might be that this problem happens at times other than on-load. Hence my suggestion of “never allow a change focus whilst the user is typing”. If I have typed in the last two seconds (configurable?), focus belongs to me not to Firefox and not to the webpage.

Revision history for this message
In , Dddeeefff (dddeeefff) wrote :

I agree with Mournir Lamouri that this problem is may be complicated than I first thought when I posted a duplicate bug a few years ago, and welcome his introduction of debate into this discussion

I do, however find his suggestion that websites should use autofocus unhelpful. I suspect the majority of web developers are not accessibility gurus who have the time to pay attention to issues like this.

I would like to prompt for examples where a broken refocus would cause an issue to the user.
I can think of an example where this might break the website, but doesn't affect the user much: auto-advancement to the next field when the character limit is reached in, for example, keys that are broken by spaces for ease of use (can't remember the term for this right now).

I feel the next stage of discussion should be about when and where focus can be altered by a webpage or the gui, and if we can isolate these instances if needed

One such case is password fields. I believe it is a critical security flaw that a user's password can be revealed to anyone watching the screen, be it in the workplace or over a projector screen. (@Mournir Lamouri I hope you won't suggest "learn touchtyping" :) )

Until further discussion on this issue, I move that refocussing should be disabled for password fields whilst the user is typing. Can we agree on this?

Changed in firefox:
status: Confirmed → Unknown
Changed in firefox:
status: Unknown → Confirmed
Revision history for this message
In , Bug-husbandry-bot (bug-husbandry-bot) wrote :

https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.

Changed in firefox:
importance: Wishlist → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.