need click twice after hide a shown bootstrap popover

I recently came across this bug and this is how I fixed it:

        trigger: 'manual', /* <- important, instantiates popover */
        container: 'body', /* optional */
        animation: false
    .click(function(e) {
        $('.popover').not(this).hide(); /* optional, hide other popovers */
        $(this).popover('show'); /* show popover now it's setup */

Still not fixed in 3.3.6 but I found a proposed solution here:

I've applied it in the hidden event:

$('body').on('', function (e) {
    $("bs.popover") = false;

This works for me. To be exactly the same as the proposed fix it would be:

$('body').on('', function (e) {
    $("bs.popover").inState = { click: false, hover: false, focus: false }

Note: I use delegated popovers which is why i'm using the $('body') reference.

For Bootstrap 4 use _activeTrigger instead of inState:

$("bs.popover") = false