-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 positioning when containerPadding is set #6577
Conversation
testing against chromatic, ideally calling updatePosition multiple times shouldnt break the positiong though...
overlay.style.left = ''; | ||
overlay.style.right = ''; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the tooltip is flipped from its previously calculate position, there is a scenario where both left and right are applied on the overlay at the same time where the left/right set respectively are the values to position the tooltip to the right/left of the button respectively, resulting in the tooltip squishing itself in an attempt to fufill both constraints. Clearing it out here means this won't happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to reproduce this in Firefox and accidently found some interesting behavior. It's pre-existing. The following is an .mov file.
https://github.com/adobe/react-spectrum/assets/309540/fd4e5a2f-f24a-4281-aff0-ab136136e2be
@ktabors ah, super weird, looks like it is constantly flipping back and forth I guess? Def file a bug for it so we have it tracked if its preexisting |
## API Changes
unknown top level export { type: 'any' } |
Caught by Chromatic
✅ Pull Request Checklist:
📝 Test Instructions:
See https://www.chromatic.com/build?appId=5f0dd5ad2b5fc10022a2e320&number=750. You can also try building the chromatic storybook locally and testing the story there but I noticed it doesn't flip like it does in chromatic (seems to be a separate issue though)
🧢 Your Project:
RSP