Skip to content
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

USWDS - Bug: Tooltip documentation claims the tooltip positioned "top" when not specified; Incorrectly positions bottom left #5218

Closed
2 tasks done
danbrady opened this issue Apr 7, 2023 · 1 comment · Fixed by #5228
Assignees
Labels
Package: Tooltip Type: Bug A problem in the code
Milestone

Comments

@danbrady
Copy link
Contributor

danbrady commented Apr 7, 2023

Describe the bug

The tooltip documentation says:

By default, tooltips appear on the top of their related element.

and

  • data-position="top": On top, horizontally centered. If the data-position attribute is omitted, the tooltip will appear on top by default.

However, when data-position is not specified at all, the tooltip is incorrectly positioned bottom left of trigger.

Steps to reproduce the bug

  1. Create a button with class="usa-tooltip" and title but no data-position attribute.

Expected Behavior

Tooltip should appear as if data-position="top" is set.

Related code

<div class="padding-8">
  <div class="margin-4">
    <button type="button" class="usa-button usa-tooltip" title="Tooltip">Show tooltip</button>
  </div>
</div>

Codepen demo

Screenshots

image

System setup

  • 3.4.1
  • Desktop
  • MacOS 11.7.4
  • Chrome v111.0.5563.146

Additional context

Would be happy to tackle this if confirmed!

Code of Conduct

@danbrady danbrady added Needs: Confirmation We need to confirm that this is an issue Status: Triage We're triaging this issue and grooming if necessary Type: Bug A problem in the code labels Apr 7, 2023
@mejiaj mejiaj added Package: Tooltip Added during Sprint and removed Needs: Confirmation We need to confirm that this is an issue Status: Triage We're triaging this issue and grooming if necessary labels Apr 14, 2023
@mejiaj
Copy link
Contributor

mejiaj commented Apr 14, 2023

Thank for taking this on! I can confirm using a tooltip without position set results in incorrect placing.

<button type="button" class="usa-button usa-tooltip"  title="No position set on this tooltip">Hello world</button>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Tooltip Type: Bug A problem in the code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants