Can someone explain to me why this event triggers twice? It doesn\'t seem to do it on jQuery versions prior to 1.7.
From the internals, it looks like triggering blur
event is triggering blur
and focusout
events internally which is invoking the onblur
twice.
PoC
$('#box').on('blur focusout', function (e) {
console.log('this too', e.type);
});
$('#box').blur();
Demo: Fiddle
The blur event is a non bubbling event, the bubbling counterpart is the foucsout event. So in normal circumstances the blur operation triggers both these events. So jQuery is trying to be intelligent and fires both these events in case of a blur event, but it looks like there is an bug in the implementation.