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.

tooltip displays at a wrong offset for elements with display set to none

See original GitHub issue

CodePen demo

Note: this pen will not demonstrate the issue when the element is hovered when Tooltip initializes. You might want to reload the frame after the pen loads.

https://codepen.io/anon/pen/NvJeRy?editors=1111

Steps to reproduce the problem

  1. Set element’s style to display: none
  2. Instantiate a Tooltip on that element
  3. Set element’s style to display: inline-block

What is the expected behavior?

At step 3. Tooltip should display at a correct offset i.e. as it would display when the element was set to display: inline-block at step 1. to begin with.

What went wrong?

At step 3. Tooltip displays at a wrong offset.

Any other comments?

How it is after hover (see codepen): image

How it should be after hover (see codepen):: image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mechaniciouscommented, Sep 6, 2017

You can do it like this https://jsfiddle.net/z4zeg74w/

0reactions
FezVrastacommented, Oct 17, 2017

This is all cool stuff and cool ideas. But they are too specific and you can implement them manually

Read more comments on GitHub >

github_iconTop Results From Across the Web

tooltip displays at a wrong offset for elements with display set ...
This issue penetrates to Tooltip.js only. Have you considered delaying the positioning of the Tooltip.js to when the anchor element becomes ...
Read more >
Bootstrap tooltip in wrong position on initial hover, then in ...
I have an svg on the page with elements that are being added and sized with javascript (d3). It seems like I need...
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 v5.0
Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-bs-attributes for local title ...
Read more >
Visualization: Column Chart - Google Developers
Like all Google charts, column charts display tooltips when the user hovers ... You create a stacked column chart by setting the isStacked...
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