Open Bug 135344 Opened 22 years ago Updated 2 years ago

Onchange handler on form elements fires when mozilla window loses focus


(Core :: Layout: Form Controls, defect, P3)






(Reporter: bzbarsky, Unassigned)


(Keywords: testcase)


(1 file)

BUILD: 2002-04-03-08 Linux nightly

1)  Load attached testcase
2)  Follow steps listed in testcase

EXPECTED RESULT:  onchange does not fire until form element loses focus

ACTUAL RESULT:  onchange fires when mozilla window loses focus even if the form
                element is the thing that will regain focus when mozilla is

CONSEQUENCES:  The "action to perform" radio button on bugzilla bugs will
               sometimes get toggled by the simple act of moving the mouse
               pointer out of the Mozilla window.

NOTE: This affects XBL form controls _and_ regular form controls.
Attached file testcase
Assignee: rods → jkeiser
Keywords: testcase
Erm.  Perhaps we receive a lost focus event in this case even if focus is going
to come back?  It seems to me that the problem is likely in the sending of the
events rather than the form controls' implementation of them.
QA Contact: madhur → tpreston
This is worse on Linux than other places, but it sounds like a
difficult-to-track fix for a bug with somewhat low consequences.  Setting to
future, reassigning to nobody.  Feel free to argue if there is a really evil
problem caused by this I have missed.
Assignee: jkeiser → form
Priority: -- → P3
Target Milestone: --- → Future
This is probably dependent on the "when window loses focus onblur event handlers
are fired" bug that we have....
Assignee: layout.form-controls → nobody
QA Contact: tpreston → layout.form-controls
I can reproduce this bug with Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0.

Though this is an old bug, I had never noticed it until several weeks/months ago. The problem is that nowadays with more and more web sites using forms, I get an error just because the Firefox window loses the focus (as I have to do some work in another application and I use "focus follows mouse"). Here's a typical example:

1. Click in the "Adresse Email" field (to enter the e-mail address).
2. Give the focus to another window (typically, the goal is to do a copy-paste of the e-mail address when one notices that it isn't in the history).

Just after (2), I get an error "Veuillez renseigner tous les champs" because this e-mail address field has not been filled in.

I'm not sure whether this is the same bug exactly, but at least it is very similar. In all these cases, the web site shouldn't be aware when the Firefox window loses the focus: the fact that the window has lost the focus doesn't mean that the field has lost the focus (the field still virtually has the focus, when the Firefox window will regain the focus).
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.