Modify ↓
Ticket #7768 (closed bug: invalid)
Focus Event does not get triggered in Safari and Chrome
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.6 |
| Component: | event | Version: | 1.3.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
There is a nice demo for this online: http://pastebin.me/973509bd873d9ef90fa19c961e77fb27
Change History
comment:2 Changed 2 years ago by snover
- Status changed from new to closed
- Resolution set to invalid
Technically, certain elements don’t focus when they are clicked on, they just activate. This varies between browsers and operating system HIGs. (For instance, clicking a button in Mac OS never focuses it on *any* browser.) It’s not a bug. Also, the code in jitter’s test case is a bit wrong—tabindex -1 disables focusability; tabindex ≥0 enables it. revised test case
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a test case! After checking your report and test case it's unclear why you did report this for version 1.3.1? Anyhow, this isn't a jQuery issue but a browser issue. From focs() documentation.
and
and
Also look at e.g. quirksmode focus table (may not be uptodate) which gives a nice impression on how differently this event is supported across browsers.
In Chrome/Safari certain elements simply don't get the "keyboard focus" when clicking on them, you can see that they are not highlighted and that e.g. hitting ENTER/SPACE doesn't do anything to the e.g button you just clicked. But you can give these elements the focus by using the TAB key and voilà the event is triggered.
This is actually a Webkit bug (bug #22261) and it isn't clear if they are ever going to fix this or just keeping it like this because that's how Mac/Safari did this the last 8 years.
test case where you can try out the TAB focus thingy and see that tabIndex makes also the stuff in the 3rd box focusable.
I guess this is a wontfix but leaving it still open so others can share their view on this one.