question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misaligned tooltips with certain inline elements

See original GitHub issue

Describe the bug

I have a problem where a lot of our tooltips are (slightly) misaligned. This happens mostly on inline(-block) spans and i-elements (mostly: font awesome icons). The tooltip & its anchor (the little arrow at the bottom of the tooltip) are off-center. 95% of the times the misalignment only happens horizontally, and it is usually in a range of 1 to 20 pixels. In 5% of the cases, there is (also) a very slight vertical misalignment (usually the tooltips is then placed 1 or 2 pixels too low).

The misalignment varies per location/page, in that in one place the tooltips are placed a bit too far to the left, and on other locations a bit too far to the right. If the misalignment was the same everywhere, I would probably have fixed it already via a CSS rule (not the ‘real’ solution of the problem of course, but it keeps my work process going). It happens with elements that are close to the page edges, as well as with elements that are sufficiently far away from it (so the misalignment cannot be caused by the fact that there is not enough room for it to be shown centered correctly).

The code that I am using, usually looks like this: v-b-tooltip.hover="{ customClass: 'vue-clm', delay: { show: 100 } }" title="Some tooltip text"

When I use the same code with bootstrap-vue buttons, the tooltips seem to be always aligned correctly. On older pages of our application, where we use straight Bootstrap 3, the tooltips are aligned correctly on all elements. So it seems to be a problem with bootstrap 4 and/or bootstrap-vue. I have this problem at least for a few months (and bootstrap-vue minor versions) now.

Versions

  • bootstrap: v4.3.1
  • bootstrap-vue: v2.15.0
  • vue: v2.6.12

Environment: It happens in both of our supported desktop browsers: IE11 and Chrome 86.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Tarraskcommented, Feb 10, 2021

Can this be related to https://github.com/popperjs/popper-core/issues/457

I also have misaligned issue and adding .tooltip { top: 0 } in my main css as suggested by @YoranBrondsema fixed the issue on my side.

0reactions
stale[bot]commented, Apr 16, 2022

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are some of my inline tooltips out of alignment?
It's because the ones that are off by a few pixels have two rows of text. Hence, why the spacing is off. What...
Read more >
Display issues with tooltip container - Qualtrics Community
Your inline positioning is correct. It's your CSS that is causing the weirdness on your survey. My CSS: /* Tooltip container */ .tooltip...
Read more >
Building a simple tooltip component that never goes off screen
How to build a simple, responsive and lightweight tooltip web component, with minimal HTML, CSS and JavaScript and no framework dependency.
Read more >
Tooltips - Bootstrap
The tooltip plugin generates content and markup on demand, and by default places tooltips after their trigger element. Trigger the tooltip via JavaScript:...
Read more >
CSS tooltip: how to auto center over element? - SitePoint
Other browsers won't play ball and you would need to add an extra element and move the tooltip which kind of defeats the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found