Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14577 closed bug (wontfix)

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

Reported by: mike.aash+jq@… 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

Change History (5)

comment:1 Changed 6 years ago by dmethvin

Owner: set to mike.aash+jq@…
Status: newpending

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

comment:2 Changed 6 years ago by anonymous

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.

comment:3 Changed 6 years ago by dmethvin

Owner: mike.aash+jq@… deleted
Status: pendingnew

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

This looks like a duplicate of #13041 to me.

comment:4 Changed 6 years ago by dmethvin

Cc: miketaylr added
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.

comment:5 Changed 6 years ago by miketaylr

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

Note: See TracTickets for help on using tickets.