[popups] Fix flash at origin before positioning completes in Preact#3975
[popups] Fix flash at origin before positioning completes in Preact#3975atomiks merged 5 commits intomui:masterfrom
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile OverviewGreptile SummaryPrevents flash at origin by setting Key changes:
The approach is sound and follows the PR author's reasoning about avoiding Confidence Score: 4/5
|
| const base = adaptiveOrigin | ||
| ? { position: resolvedPosition, [sideX]: x, [sideY]: y } | ||
| : { position: resolvedPosition, ...originalFloatingStyles }; | ||
| return !isPositioned ? { ...base, opacity: 0 } : base; |
There was a problem hiding this comment.
Check that tooltips with CSS opacity transitions work correctly. When isPositioned changes from false to true, the inline opacity: 0 is removed. Test that this timing works smoothly with entrance transitions to ensure there's no brief flash before CSS animations start.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/react/src/utils/useAnchorPositioning.ts
Line: 429:429
Comment:
Check that tooltips with CSS `opacity` transitions work correctly. When `isPositioned` changes from `false` to `true`, the inline `opacity: 0` is removed. Test that this timing works smoothly with entrance transitions to ensure there's no brief flash before CSS animations start.
How can I resolve this? If you propose a fix, please make it concise.|
I actually had a PR open #3963 but hadn't added tests yet. We can keep this one. Can you change the logic to mutate the object as I've done (for perf) |
ah whoops, thanks for the looking into this I appreciate it |
atomiks
left a comment
There was a problem hiding this comment.
Thanks for the fix @OliverSpeir
Went with opacity because visibility hidden affects focus, happy to go another route though of course
Fixes #3958