Skip to main content

Bug Tracker

Side navigation

#14577 closed bug (wontfix)

Opened November 27, 2013 03:42PM UTC

Closed December 08, 2013 03:16PM UTC

Last modified December 10, 2013 10:09PM UTC

:focus selector does not work for <INPUT type=file> in Firefox

Reported by: mike.aash+jq@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.3
Keywords: Cc: miketaylr
Blocked by: Blocking:
Description

:focus or input:focus does not return a match for INPUT type=file in Firefox. You get an empty jQuery object. Works for all other input types. See http://jsfiddle.net/33Qvv/ for an example. Tab through the input field and note the results in the console for the file input.

Firefox v25.0.1

Windows 7

Attachments (0)
Change History (5)

Changed November 27, 2013 03:54PM UTC by dmethvin comment:1

owner: → mike.aash+jq@gmail.com
status: newpending

Can you create a plain-DOM test case? If it happens there it should be reported to Mozilla.

Changed November 27, 2013 08:52PM UTC by anonymous comment:2

By plain-DOM test case do you mean one without jQuery? I'm not clear on what you want to see in such a test case. There isn't a native focus selector that I'm aware of. The fiddle I linked to is using document.activeElement to compare to :focus.

Changed November 27, 2013 10:33PM UTC by dmethvin comment:3

owner: mike.aash+jq@gmail.com
status: pendingnew

I meant something like this: http://jsfiddle.net/33Qvv/5/

This looks like a duplicate of #13041 to me.

Changed December 08, 2013 03:16PM UTC by dmethvin comment:4

cc: → miketaylr
resolution: → wontfix
status: newclosed

This specific problem could be fixed with some Sizzle acrobatics I suppose, but it's such an edge case that it wouldn't be worth the bytes.

An <input type=file> is kind of a strange one since there's only a button and then a separate file choice dialog controlled by the browser. If you think Firefox should consider :focus on this element, file a ticket with Mozilla and post a link to the ticket here.

Changed December 10, 2013 10:09PM UTC by miketaylr comment:5

Feel free to cc :miketaylr at bugzilla.mozilla.org if you decide to file a bug, Mike.