twitter/bootstrap — Issue #1209: Popover closes unexpectedly in Firefox 9.0.1
Author: commadelimited
Created: 2012-01-25 17:45:33+00:00
State: open

I implemented the Bootstrap popover on a site I'm building, using the toggle method.

http://andy.goba.mobi/

It contains a form encouraging users to input their phone number to receive a download link for our mobile app. In Chrome 17.0.963.38 beta, mobile safari (iOS), and Safari 5.1.2 it behaves as expected. I click the trigger link, and the modal opens. Clicking anywhere on the page does nothing until I click the trigger again to close the window.

In Firefox the modal behaves erratically. On initial load a single click opens, then closes the modal. A subsequent click opens the modal, but clicking into it (or anywhere else on the page) causes it to close. It then repeats that pattern.

1st click - opens a closes the modal
2nd click - closes the modal
lather rinse repeat.

This is the code I'm using to implement the popover:
$('.module h2 a').popover({
trigger:'toggle',
html: true,
offset: 28,
placement: 'above',
content: function(what){
return $('#fSubmitForm').html();
}
})
.click(function(e){
e.preventDefault();
// open the popover
$(this).popover('toggle');
});

Note: changing the trigger config option to manual and the issue goes away.