Skip to content

Tooltips not taking into account the margin of their anchor #2068

Closed
@jdrush89

Description

@jdrush89

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:

  1. 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
Screen Shot 2022-05-11 at 4 09 57 PM

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions