2

I have a bootstrap popover with the following configuration/initialization:

$element.popover({trigger: 'manual'});

with

$element.data('bs.popover').options.content = 'some text';
$element.popover('show');

the popover will be triggered. but after the second appearance of the popover, it shows up for a second and disappears immediately. after that the popover element is destroyed.

after debugging bootstrap.js, i can say, that neither the "hide" nor the "destroy" action is triggered after the "show"-action.

EDIT:

okay, i fixed it... before one popover is shown, a "hideAll" method(this includes the popover which will have to be shown) was called. i guess the hide of one popover is called asynchronously by bootstrap, because of the fading out animation.

now i except the specific popover from the hideAll ... and all works fine

Cœur
  • 37,241
  • 25
  • 195
  • 267
charlieMACK
  • 165
  • 9

1 Answers1

0

I have had a similar issue. I had a bunch of popovers in place to guide a user through filling out the inputs in a form. My validation step would choose the next input that needed it's popover activated, hide all popovers and then show the one for the next input. I liked the idea that I could ensure that only one popover was visible at a time by always hiding all $('[data-toggle="popover"]').popover("hide"); then showing one with $('#' + current_popover_id).popover("show");. The asynchronous nature what not as consistent as I hoped. I ended up hiding one popover and showing one popover at a time.

Justin
  • 474
  • 4
  • 14