Solution: #jQuery #bootstrap popover focus not working in Chrome


Updated November 15, 2013 ● 5,578 views

As I was developing this website, focus trigger for bootstrap popover doesn't work in Chrome. As a workaround, I used the following code below. You can see this in action by clicking on the user thumbnail below the title of this article.

As work around do the following using the default click trigger:

jQuery(function($) {
    $(".pop-user-info").popover({placement:"top"});
    jQuery("body").on("click",".pop-user-info",function(){
        $(this).popover();
        $(".pop-user-info").not(this).popover("hide"); //hide other popovers
        return false;
    });
    jQuery("body").on("click",function(){
        $(".pop-user-info").popover("hide"); //hide all popovers when clicked on body
    });
});

2 Comments

Sort by Best Controversial New
 
0

What is "pop-user-info"? Is this the class for each popovers? I don't have to use an Id?

David · 10 years ago
permalink · reply (0)
0

It's working, but is there a way to just mkae it on hover. I'm trying to do hover but the popover disappears when mouse moves.

Prakash1 · 10 years ago
permalink · reply (0)