Bootstrap: Tooltip not appends to given element

Created on 10 Feb 2017  路  4Comments  路  Source: twbs/bootstrap

Bootstrap 4 alpha 6.
I'm trying to append tooltip to element by using the container option, but it's not working.
JSFiddle

js v4

Most helpful comment

I found that tether have bodyElement option which can be used to specify which element the tether's should attach themselves to. The problem is that tether currently makes the assumption that all of its calculations must be relative to the body, So even if we will use this option the container element will have to be same size and position respect to the body.
Maybe Popper.js is more suitable than Tether.js?

All 4 comments

Same issue here. From what I see, tooltip gets added to the container first, but then tether moves it back to the body here. I found that tether scans container and all its parent nodes up to the body, if it finds an element with a non-static position - it moves a tooltip (see here). In reality tooltip always ends up in the body, cause grid classes like .col-12 use relative position.

I found that tether have bodyElement option which can be used to specify which element the tether's should attach themselves to. The problem is that tether currently makes the assumption that all of its calculations must be relative to the body, So even if we will use this option the container element will have to be same size and position respect to the body.
Maybe Popper.js is more suitable than Tether.js?

Closed and fixed by #22444

Was this page helpful?
0 / 5 - 0 ratings