Open
Bug 1042402
Opened 10 years ago
Updated 2 years ago
No focus or blur events fire when text is dropped into <input>
Categories
(Core :: General, defect)
Tracking
()
UNCONFIRMED
People
(Reporter: ralphma1109, Unassigned)
Details
(Keywords: reproducible, testcase)
Attachments
(1 file)
223 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36 Steps to reproduce: 1. Created input field with an onblur callback. 2. I dragged text (using the mouse) into the input field and then clicked space outside the input field. 3. Onblur event was not called. I tried this on chrome and safari, both worked. Using the testfile: Drag the text "Test Text" into the input box. Then click out of the box. An alert would pop up if onBlur was called. This is not the case, showing that the onBlur event is not called at the proper time. Actual results: Onblur event was not called when I clicked space outside the input. Expected results: After dragging the text, onblur should be called if I click out of the input box.
Comment 1•10 years ago
|
||
This is interesting. Arguably, the input field is never really focused - the selection remains available, and so the input field isn't and was never focused (there is no corresponding focus event in your testcase). Why would you expect onblur to be called without focus happening?
Comment 2•10 years ago
|
||
(In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #1) > This is interesting. Arguably, the input field is never really focused - the > selection remains available, and so the input field isn't and was never > focused (there is no corresponding focus event in your testcase). > > Why would you expect onblur to be called without focus happening? This time with needinfo... :-)
Flags: needinfo?(ralphma1109)
Reporter | ||
Comment 3•10 years ago
|
||
(In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #2) > (In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #1) > > This is interesting. Arguably, the input field is never really focused - the > > selection remains available, and so the input field isn't and was never > > focused (there is no corresponding focus event in your testcase). > > > > Why would you expect onblur to be called without focus happening? > > This time with needinfo... :-) I did play around with it more and noticed the field doesn't gain focus. Is there a reason, why input fields in Firefox do not gain focus when text is dragged in? I feel like a lot of developers would use onFocus and onBlur to trigger validation for texts placed in a field. But this would not work for dragged in text.
Flags: needinfo?(ralphma1109)
Reporter | ||
Comment 4•10 years ago
|
||
(In reply to ralphma1109 from comment #3) > (In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #2) > > (In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #1) > > > This is interesting. Arguably, the input field is never really focused - the > > > selection remains available, and so the input field isn't and was never > > > focused (there is no corresponding focus event in your testcase). > > > > > > Why would you expect onblur to be called without focus happening? > > > > This time with needinfo... :-) > > I did play around with it more and noticed the field doesn't gain focus. Is > there a reason, why input fields in Firefox do not gain focus when text is > dragged in? I feel like a lot of developers would use onFocus and onBlur to > trigger validation for texts placed in a field. But this would not work for > dragged in text. Also wanted to highlight that input fields in both chrome and safari do gain focus.
Comment 5•10 years ago
|
||
(In reply to ralphma1109 from comment #3) > (In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #2) > > (In reply to :Gijs Kruitbosch (Gone July 26 - August 3) from comment #1) > > > This is interesting. Arguably, the input field is never really focused - the > > > selection remains available, and so the input field isn't and was never > > > focused (there is no corresponding focus event in your testcase). > > > > > > Why would you expect onblur to be called without focus happening? > > > > This time with needinfo... :-) > > I did play around with it more and noticed the field doesn't gain focus. Is > there a reason, why input fields in Firefox do not gain focus when text is > dragged in? I don't know. Olli?
Flags: needinfo?(bugs)
Summary: onBlur event is not called when text is dragged into field and the field loses focus → No focus or blur events fire when text is dropped into <input>
Comment 6•10 years ago
|
||
I don't see any reason why dropping should focus the drop target. Scripts could always call .focus() if needed.
Flags: needinfo?(bugs)
Comment 7•10 years ago
|
||
Also, I don't see anything in HTML spec which would hint dropping should focus possibly focusable target.
Reporter | ||
Comment 8•10 years ago
|
||
Okay, I can understand that this isn't a bug. However, I think it would be beneficial for firefox users and developers if dragging text into a text box triggered some event. Since the focus event is not fired, the change event is not fired either.
Comment 9•10 years ago
|
||
I'd assume the input event is fired, no?
Comment 10•10 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #9) > I'd assume the input event is fired, no? yes
Reporter | ||
Comment 11•10 years ago
|
||
Did not know that, thank you guys.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•