bootstrap-select
bootstrap-select copied to clipboard
Blur Event still broken
.blur does not fire still for me, I cited it in another issue, where someone posted a jsfiddle.
Anyone having any luck?
-Mark
@gravesmedical
While the blur event does not event does not appear to work, it may be acceptable to use the hidden.bs.dropdown event fired by Bootstrap's dropdown component, since this plugin makes use of that. This would have to be registered after the bootstrap-select has been initialized.
$('.bootstrap-select').on('hidden.bs.dropdown', function () {
console.log('hidden');
});
http://jsfiddle.net/sn7zrLdb/1/
If using bootstrap-select >v1.7.0, it would be better to use:
$('#boo').on('hidden.bs.select', function () {
console.log('hidden');
});
Alternatively, if you really need to use blur, you need to use the button as the element - not the dropdown container. e.g.:
$(".boo .dropdown-toggle").blur(function() {
alert(2);
});