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

fix(tooltip): correct positioning when unstyled is applied #831

Closed
wants to merge 3 commits into from

Conversation

williaster
Copy link
Collaborator

🐛 Bug Fix

This PR

  • fixes TooltipWithBounds bug #767 where setting unstyled on TooltipWithBounds breaks positioning because it is passed to Tooltip, which then doesn't respect the style prop which includes the needed offset
  • fixes an issue where if unstyled is set on either Tooltip or TooltipWithBounds, lib consumers must also minimally set .visx-tooltip { position: absolute; } themselves in order for the tooltips to be correctly positioned since they rely on absolute positioning.
    • this was fixed by removing position: absolute from defaultStyles, and always setting it (along with the positional offset)

Testing
Verified in /tooltip demo that tooltip is correctly positioned when unstyled is set for all combinations

  • boundary detection + portal
  • boundary detection + portal
  • boundary detection + portal
  • boundary detection + portal

@hshoff @kristw @singhanurag05

@coveralls
Copy link

coveralls commented Oct 1, 2020

Pull Request Test Coverage Report for Build 282956020

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 54.417%

Totals Coverage Status
Change from base Build 42: 0.08%
Covered Lines: 1099
Relevant Lines: 1976

💛 - Coveralls

@torkelo
Copy link

torkelo commented Oct 3, 2020

Nice! just ran into this today!

@williaster
Copy link
Collaborator Author

Closing in favor of #828

@williaster williaster closed this Oct 5, 2020
@williaster williaster deleted the chris--fix-unstyled-tooltip branch October 5, 2020 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TooltipWithBounds bug
4 participants