So I do research and found this has a solution and I already implement it and it work!
Here is the solution:
You need to declare your popover with
data-toggle="popover"And you need to add javascript like this
$('body').on('click', function (e) {And then you can see that this code working like a charm
$('[data-toggle="popover"]').each(function () {
//the 'is' for buttons that trigger popups
//the 'has' for icons within a button that triggers a popup
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
$(this).popover('hide');
}
});
});