Open Bug 493416 Opened 15 years ago Updated 2 years ago

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

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

2.0 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: guntiso, Unassigned)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) 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
Attached file Test case
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → 1.9.0 Branch
Have the same problem in

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

My test shows exactly the same 
http://jsbin.com/evebe3
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
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.
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
Component: Event Handling → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: