fix: hide unmeasured tooltips during exit - #10502
Open
devo-id wants to merge 3 commits into
Open
Conversation
Author
|
I investigated the failing s2-docs check locally by running the same build on both my PR branch and upstream/main. Both fail at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10496
When a Tooltip starts its exit animation before its position has been calculated, it can remain mounted with the fallback
position: fixed; top: 0; left: 0styles and briefly appear at the top-left of the viewport.This change hides the tooltip when it is closed and does not have a computed placement:
Normally positioned tooltips and their exit animations are unchanged.
Pull Request Checklist:
Test Instructions:
Run:
yarn jest packages/react-aria-components/test/Tooltip.test.jsThe regression test
hides unmeasured tooltips during exit animationshould fail onupstream/mainand pass with this change.Also verified:
yarn jest packages/react-aria-components/test/Toolbar.test.tsxyarn jest packages/react-aria/test/overlays/useOverlayPosition.test.tsxyarn jest packages/react-aria-components/test/Popover.test.jsyarn oxlint packages/react-aria-components/src/Tooltip.tsx packages/react-aria-components/test/Tooltip.test.jsyarn oxfmt --check packages/react-aria-components/src/Tooltip.tsx packages/react-aria-components/test/Tooltip.test.js