I think that’s because Bootstrap use document.on(‘click’, ‘selector’, function ).
This means that the function will execute only when the click event reached the document Node.
I tested and If you have a parent element which does not propagate the ‘click’ event, then that can be a reason of why your code doesn’t work…
Ex:
parentNodeOfTab.on( 'click', function(){
// Code
return false;
} );
or
parentNodeOfTab.on( 'click', function( event){
event.stopPropagation();
// Code
} );
P.S: You can Google and read more about JavaScript propagation.