Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position is off if the content of the tootip's height changes #993

Closed
akraines opened this issue Mar 28, 2023 Discussed in #991 · 3 comments · Fixed by #994
Closed

Position is off if the content of the tootip's height changes #993

akraines opened this issue Mar 28, 2023 Discussed in #991 · 3 comments · Fixed by #994

Comments

@akraines
Copy link

akraines commented Mar 28, 2023

Discussed in #991

Originally posted by akraines March 28, 2023
It seems that position is off if the content of the tooltip's height changes. Is there a way to indicate to the tooltip to recalculate its position based on the height of the dynamic content of the tooltip?
I'm trying to work out why tooltips are being positioned way out of place on first render of the cell in my app. On the second render it positions itself correctly. I have considered 2 possibilities:

  1. The tooltip is associated with a row that is being rendered as part of a virtual list.
  2. The height of the tooltip changes as part of its first render [it first says loading and then displays the content.] As a test I gave the tooltip a fixed height and it seemed to fix the issue.

I looked into it further and made a repro: https://stackblitz.com/edit/react-ts-ay7kkp?file=App.tsx,index.tsx

@gabrieljablonski
Copy link
Member

Check this example and try it out with the beta release [email protected] and let me know if it works.

@akraines
Copy link
Author

It worked like a charm. Thank you. See my comment to the pull request for a suggestion about how to circumvent the need to use a forwarded ref.

@gabrieljablonski
Copy link
Member

Fixed on [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants