onclick event not triggered - text input - after onfocus value change




9 years ago
3 years ago


(Reporter: guntiso, Unassigned)


2.0 Branch
Windows XP

Firefox Tracking Flags

(Not tracked)



(2 attachments)



9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/2009042316 Firefox/3.0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/2009042316 Firefox/3.0.10

Text input onclick event is not triggered for clicks on the text which is cleared/modified using onfocus handler (it is triggered however, for clicks on the right of that text, or if value does not change).

Reproducible: Always

Steps to Reproduce:
1. Open attached page
2. Click on the text in the box
Actual Results:  
Counter not changed

Expected Results:  
Counter should increment

Comment 1

9 years ago
Created attachment 377887 [details]
Test case
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → 1.9.0 Branch

Comment 2

8 years ago
Have the same problem in

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20100401 Firefox/3.6.3

My test shows exactly the same 

Comment 3

7 years ago
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

still has the same problem with my test: If field is not focused, you click on the text in the field and that text is changing on focus, the click listener is not executed.

If you however click in the blank part of the field then the click listner is excuted.

For click listener to be executed, now you may also click on "to be blank" part of the field. I believe this is new behavior (Firefox 4)

Test by j.alkjaer does not show the problem, because it clears the text entirely.
Version: 1.9.0 Branch → 2.0 Branch

Comment 4

4 years ago
I do not reproduce the reported issue with the attachment provided by guntiso and with my current version of Firefox 31.0, I believe this was fixed?

However I reproduce a very similar issue when instead of changing the value, I remove the placeholder attribute of the input. C.f. attachment.
When clicking the first time on the input, the counter is not incremented. When clicking a second time (or more), it is incremented. This happens whether clicking on the text or outside of it.

Comment 5

4 years ago
Created attachment 8475671 [details]
Test case with placeholder removal

Comment 6

3 years ago
Reproduces in Firefox 37.0.2 with following jsfiddles:

- http://jsfiddle.net/ms4tmw3x/3/ - placeholder of input is changed in focus event handler
- http://jsfiddle.net/ms4tmw3x/4/ - style of focused input is changed via CSS
You need to log in before you can comment on or make changes to this bug.