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): use layout effect to calculate width #1370

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

stipsan
Copy link
Member

@stipsan stipsan commented Jul 11, 2024

Follows up on #1369 by fully resolving the layout trashing by measuring layout inside a useLayoutEffect and then schedule another render before the tooltip paints, avoiding flicker.

The useCloseOnMouseLeave hook is also slightly rewritten to hopefully resolve the failing tests on sanity: https://github.com/sanity-io/sanity/actions/runs/9892053091/job/27325213848?pr=7136

Copy link

vercel bot commented Jul 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sanity-ui-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 1:40pm
sanity-ui-workshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 1:40pm

@stipsan stipsan enabled auto-merge (squash) July 11, 2024 13:40
@stipsan stipsan merged commit e39ddbe into main Jul 11, 2024
11 checks passed
@stipsan stipsan deleted the fix-tooltip-layout-trashing branch July 11, 2024 13:44
rexxars added a commit that referenced this pull request Jul 11, 2024
rexxars added a commit that referenced this pull request Jul 11, 2024
* Revert "fix(tooltip): regression where hover to open stops working (#1371)"

This reverts commit 038011b.

* Revert "fix(tooltip): use layout effect to calculate width (#1370)"

This reverts commit e39ddbe.

* Revert "fix: reduce layout trashing (#1369)"

This reverts commit 0cb1cb1.
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 this pull request may close these issues.

2 participants