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

Move tooltip to be sibling of link #1260

Merged
merged 3 commits into from
Aug 1, 2022
Merged

Move tooltip to be sibling of link #1260

merged 3 commits into from
Aug 1, 2022

Conversation

khiga8
Copy link
Contributor

@khiga8 khiga8 commented Aug 1, 2022

The Link component now supports rendering of tooltip through its API.

Currently the tooltip element is nested within the anchor element. However this will result in the tooltip element becoming a touch area for the link which is unexpected behavior.

Instead the tooltip element should be rendered adjacent to the anchor.

Additionally, to ensure the tooltip (which uses absolute positioning) is positioned correctly, this PR adds a position: 'relative container that wraps the tooltip and the anchor element. I made this a span to mimic inline positioning of link.

@khiga8 khiga8 requested review from a team and keithamus August 1, 2022 22:49
@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2022

🦋 Changeset detected

Latest commit: 8c97e09

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -43,9 +45,6 @@ class LinkComponent < Primer::Component
# @example Without underline
# <%= render(Primer::LinkComponent.new(href: "#", underline: false)) { "Link" } %>
#
# @example Span as link
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good usecase so we should remove this example.

@khiga8 khiga8 temporarily deployed to github-pages August 1, 2022 22:55 Inactive
@jonrohan jonrohan temporarily deployed to github-pages August 1, 2022 23:35 Inactive
@jonrohan jonrohan merged commit 1a6562f into main Aug 1, 2022
@jonrohan jonrohan deleted the kh-fix-tooltip-rendering branch August 1, 2022 23:48
@primer-css primer-css mentioned this pull request Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants