Closed Bug 534833 Opened 10 years ago Closed 10 years ago
click event is occasionally lost in text form controls when focus event changes the value of the control
35.79 KB, application/octet-stream
652 bytes, text/html
35.80 KB, application/octet-stream
35.81 KB, application/octet-stream
12.04 KB, patch
|Details | Diff | Splinter Review|
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:220.127.116.11) Gecko/20091102 Firefox/3.5.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:18.104.22.168) Gecko/20091102 Firefox/3.5.5 I bind two events focus and click to a text input, focus to change the value of the input, and click to do something else. At the beginning, the input has not been focused, and the value of it is "test |", then click on the input. If cilck after after the "|", the click event will be triggered, but if click before the "|", the click event will NOT be triggered. I used the JQuery-1.3.2.js library, I consider it is a bug of the Firefox, because it does not occur in any other browsers except Firefox. Reproducible: Always Steps to Reproduce: I will attach my demo, open with Firefox(I have tested with Firefox-3.5.5 and 22.214.171.124). 1.Click anywhere first to make sure the input has not been focused; 2.Click on the input AFTER the "|", then you will get "click" and "focus"; 3.Repeat step 1; 4.Click on the input BEFORE the "|", then you will get "focus" only; 5.Repeat steps 1 - 4 with any other browser, e.g. Oprea-10.10, Chrome-126.96.36.199, IE-8, the bug will not be occurred; Actual Results: The behavior in Firefox is very strange, and different form the other browsers. Expected Results: Get "click" and "focus" always. JQuery-1.3.2.js
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → 1.9.1 Branch
Any one here?
Interesting. I haven't seen this bug filed before, but I assume the problem has been there forever.
The problem is probably that when clicking the text, textframe gets mousedown then focus removes or modified the textframe and mouseup goes to the anonymous div inside <input>. Or perhaps mousedown goes to anon div, but mouseup to <input> element. I'll debug this.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Version: 1.9.1 Branch → Trunk
Summary: Bind two events focus and click to a text input, focus to change the value of the input, but the click event will not be triggered sometime. → click event is occasionally lost in text form controls when focus event changes the value of the control.
(In reply to comment #5) I have tested again, and I found all the events were triggered except "click". Click after the "|": mousedown > focus > mouseup > click; Click before the "|": mousedown > focus > mouseup.
Once I commit, I can not update anything anymore :(
I have the patch for this. I just need to mochitestify my testcases.
Assignee: nobody → Olli.Pettay
For native anonymous content, generate click, even if the target has changed from #text to anonymous div. We don't want that behavior always, since generally that is not what browsers seem to do. Posted the patch to tryserver.
Attachment #423010 - Flags: review?(roc)
Attachment #423010 - Flags: review?(roc) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.