bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Tooltips/Popovers applied inside of specific elements has side effects

Open Tape opened this issue 14 years ago • 6 comments

See jsfiddle link at the bottom of the comment. I was using icons for popover functionality as a "training mode" of sorts. The new functionality they provide in 2.2.0 breaks the expected behavior though.

http://jsfiddle.net/gY5kW/

Tape avatar Oct 30 '12 16:10 Tape

work fine..

boulox avatar Oct 30 '12 18:10 boulox

atleast in chrome, the content of the popover is shown with the font settings of the heading.

slb235 avatar Oct 31 '12 02:10 slb235

There is no issue here. All of the content is in an h3 tag, thus making it big and bold. Try closing the h3 after the "Some Heading" text, and it will work as expected. Then use a different method to keep the icon on the same line as your heading.

(I think the original question was edited as I was typing my comment, as it mentioned something about the content being the same font as the heading next to the icon.)

sq2 avatar Oct 31 '12 10:10 sq2

the old js had the option to append the popover / tooltip to body vs the element. i use position absolute in my project... with overflow hidden.. so the popovers are being hidden if they near the side etc. had to change the js to allow it to be appended to body again

WilliamStam avatar Oct 31 '12 10:10 WilliamStam

the bootstrap tooltip plugin js

old (2.1)

$tip
          .remove()
          .css({ top: 0, left: 0, display: 'block' })
          .appendTo(inside ? this.$element : document.body)

new (2.2)

$tip
          .detach()
          .css({ top: 0, left: 0, display: 'block' })
          .insertAfter(this.$element)

please give us an option to add it to body again natively? instead of having to remember to edit the js file every update of BS we do :P

WilliamStam avatar Oct 31 '12 10:10 WilliamStam

Closing as dupe of #5687.

mdo avatar Nov 01 '12 16:11 mdo