Description
Describe the bug
Tooltips should take into account the margin of the element they are targeting so they open visually pointing to it
Note: As this is a public repo, please be careful not to include details or screenshots from unreleased GitHub products or features. In most cases, a good bug report should be able to describe the new component without including business logic or feature details, but if you must discuss context relating to an unreleased feature, please open an issue in the private Design Systems repo and link to it here.
To Reproduce
Steps to reproduce the behavior:
- Take the example:
<Tooltip text="This will immediately impact all organization members">
<Button variant="primary" sx={{ml: 3}}>Save</Button>
</Tooltip>
Hover the button to see the tooltip appear off center
Expected behavior
The tooltip should take the Button's margin into account when opening so it positions still pointing to its center.
Screenshots
This is with a margin-left set on the button
Desktop (please complete the following information):
- OS: iOS
- Browser chrome
- Version: 97.0.4692.71
Additional context
It seems like other overlays like the action menu take the anchor's margin into account when positioning.