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): add strategy option to support edge use cases #83

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

pallendes
Copy link
Contributor

Description

This PR adds the option of wrapping the tooltip inside a portal to fix some edge use cases.

Checklist

  • Change increases quality
  • Change is validated by tests
  • Change is readable and easy to understand
  • Documentation is updated
  • Security impact has been considered
  • Changes validated in runtime

Copy link

linear bot commented Dec 29, 2023

@pallendes pallendes force-pushed the pla-930-migrate-from-abusix-ui-to-hailstorm-tooltip branch from d6f7997 to 996ff63 Compare December 29, 2023 14:25
rodelta
rodelta previously approved these changes Dec 29, 2023
Copy link
Contributor

@rodelta rodelta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, no stoppers.
A couple of questions, though.

  • Would it work/help if we did tooltips always via portals? if that logic works for all cases, maybe it would be better for it to be the only strategy.
  • Would be nice to have a case in storybook for quick checks that the thing is building properly

src/components/tooltip/tooltip.tsx Outdated Show resolved Hide resolved
@pallendes
Copy link
Contributor Author

pallendes commented Dec 29, 2023

LGTM, no stoppers. A couple of questions, though.

  • Would it work/help if we did tooltips always via portals? if that logic works for all cases, maybe it would be better for it to be the only strategy.
  • Would be nice to have a case in storybook for quick checks that the thing is building properly
  1. I didn't want to leave it always to use portals, as it will add extra complexity to the rendering when, in most cases, using a portal is not needed, or just the "fixed" strategy can do the trick. Also, I can't be sure that using it inside a portal will work for all cases, as we can find more scenarios where it might not work for any reason. Therefore, I went for the more flexible alternative.

  2. What do you mean by a case in a storybook? You can check all the possible scenarios by playing with the arguments in the documentation. Adding a specific case for portal strategy won't produce any visual difference.

@pallendes pallendes merged commit eed6ac4 into main Jan 3, 2024
5 checks passed
@pallendes pallendes deleted the pla-930-migrate-from-abusix-ui-to-hailstorm-tooltip branch January 3, 2024 11:25
@abusix-bot
Copy link
Collaborator

🎉 This PR is included in version 3.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants