Initially, the tooltip functions correctly for top, bottom, and left directions. However, it fails to display properly when set to right.
This issue seems to be related to the CSS or HTML structure, even though the tooltip is positioned absolutely. The following HTML code snippet illustrates this:
HTML
<li class="">
<div class="hover-highlight ml-2">
<a class="" href="#">
<i data-toggle="tooltip" title="Dashboard" class="icon-meter"></i>
<span>Dasboard</span>
</a>
</div>
</li>
Within the javascript section, the following script attempts to address the issue:
$(function () {
$('[data-toggle="tooltip"]').tooltip({
placement: 'right'
});
});
Despite functioning correctly with other placements, there are problems specific to the right alignment. The rendered output mistakenly shows properties aligned to the left:
<div class="tooltip fade show bs-tooltip-left" role="tooltip" id="tooltip558151" style="position: absolute; transform: translate3d(125px, 207px, 0px); top: 0px; left: 0px; will-change: transform;" x-placement="left">
<div class="arrow" style="top: 8px;" />
<div class="tooltip-inner">Dashboard</div>
</div>
The Issue
Further investigation revealed that Bootstrap automatically adjusts text placement relative to the parent div. This behavior limits the ability to force the tooltip to appear on the right side of the window.
A solution to override this default behavior remains elusive.
CODE
To review the code, visit here: