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.

Tippys that are nested inside interactive tippys teleport on re-renders

See original GitHub issue

Reproduction steps

  1. Go to https://codesandbox.io/s/tippyjs-interactive-teleport-4cpy8
  2. Hover on the Hover me label, then hover on the Hover me too label.
  3. Notice that when the state changes (not even a state related to the tooltips), the nested tippy teleports to the top left (but not exactly).

I’ll note that in my app, the nested tippy teleports to a top-lefty point of the screen, but not to that corner exactly. I think the wrong calculation positions the nested content with position: absolute; top: 0; left: 0;, and shows the nested tooltip there.

You can see that if we copy the content’s dimensions into that point, the nested tooltip is perfectly positioned according to it:

image

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
DominikGuzeicommented, Feb 25, 2021

Thanks for the super-fast response @atomiks, I’m testing version 4.2.1 now to see if this is fixed in our case 😃 do you take donations for your open source work?

0reactions
atomikscommented, Feb 25, 2021

So there’s a 1 frame glitch if the nested tippy is flipping but it fixes the core issue.

I think that issue has to do with the scroll events and when they fire (the nested one must be firing first, but needs to fire once the parent has been repositioned. I think you can fix this with a modifier.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

All Props | Tippy.js
The complete tooltip, popover, dropdown, and menu solution for the web.
Read more >
React's Context API re-renders all components that are ...
The above statement is true if a context is used like in the below example where components are directly nested in the provider....
Read more >
queryselectorall element.calss Code Example - Code Grepper
Obtain a NodeList of all of the elements in the document const matches = document.querySelectorAll("p");
Read more >
Just Say No to Excessive Re-Rendering in React - GrapeCity
In this article, we will address instances of excessive re-rendering in React ... Re-renders occur when a component's state or prop changes.
Read more >
React re-renders guide: everything, all at once - Developer way
Table of Contents. What is re-render in React? When React component re-renders itself? Preventing re-renders with composition; Preventing re ...
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