Couple of minutes ago, I answered the question:
What is the difference between focusin/focusout vs focus/blur in jQuery?
The answer was:
Short answer: focusin
bubbles, focus
does not.
focusout
bubbles, blur
does not.
I tested it, it's true, but I encountered a weird thing while trying to set up a DEMO:
$('#test').on('focusin focusout focus blur change', function(e) {
console.log(e.type + 'event bubles? : ' + e.bubbles);
});
focusin
and focusout
give me e.bubbles == false
Is it a bug of jQuery or am I missing the obvious here?
Sounds like a bug in jQuery.Did you test this on a browser that supportsfocusin
andfocusout
natively? (E.g., IE?) Because if not, you're testing the flag for jQuery's emulated support.I've crossed out the "Sounds like a bug" bit above because jQuery doesn't claim to normalize the
bubbles
property in the documentation. So since it doesn't guarantee it, it doesn't have to support it on emulated events. (Note that if I run your demo on IE7, I getundefined
because IE7 doesn't support the DOM3 Eventsbubbles
property.) Still an issue, but perhaps not a bug. :-)Update:
Response on the jQuery ticket:
So my guess above was correct. It's not a bug, because they don't claim to normalize that. :-)