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 supportsfocusinandfocusoutnatively? (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
bubblesproperty 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 getundefinedbecause IE7 doesn't support the DOM3 Eventsbubblesproperty.) 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. :-)