Ticket #9452 (closed bug: invalid)
focus event does not bubble correctly
| Reported by: | anonymous | Owned by: | anonymous |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | event | Version: | 1.6.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Upon focusing an input the event does not bubble up to the parent correctly. I tried in Firefox 4 and Chrome 11. Using the workaround with 'focusin' as I understand is done for IE works properly.
Testcase: http://jsbin.com/uyaho5/3/
Focusing the element should log these six messages:
jQuery focusin, input jQuery focusin, parent native focus, parent native focus, input jQuery focus, parent jQuery focus, input
But the "jQuery focus, parent" is never logged.
Change History
comment:2 Changed 2 years ago by daniel.nr01@…
The question is why the jQuery 'focus' event does not bubble. 'focusin' (and 'focusout') work properly. I don't think it is intentional since the native focus event does bubble. I may have misunderstood something though..
comment:3 Changed 2 years ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 2 years ago by dmethvin
- Component changed from unfiled to event
Just to follow up, the W3C says that the focus event does not bubble so jQuery is doing the right thing.
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-htmlevents
For .live() and .delegate() we currently transform the focus event to focusin so that it will work at all, but I'm not in favor of doing that for .bind() because it will only add to the confusion. If you're doing manual event delegation with .bind() then use the bubbling focusin event.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Seems like it is working properly. The focusin and focusout events are the bubbling versions. Or have I misinterpreted the test case?