I have a Bootstrap popover with text input inside it. I want the popover to hide if the user clicks outside the popover, but stay open if anything inside the popover, such as an input field, gets focus.
Using trigger:focus does not work, because after displaying a popover, clicking on something, including popover, hides it.
I tried adding the $('.popover').on('blur') function, but I'm not sure how to handle checking that something inside the popover has focus when the blur event fires.
This script illustrates the unwanted behavior of http://jsfiddle.net/Lcsqjdgu/
source share