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

Tooltip2: Render tooltip element as span #4360

Merged
merged 3 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wicked-rings-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Tooltip2: Render tooltip element as `span` instead of `div`
2 changes: 1 addition & 1 deletion packages/react/src/TooltipV2/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const animationStyles = `
animation-delay: 0s;
`

const StyledTooltip = styled.div`
const StyledTooltip = styled.span`
/* Overriding the default popover styles */
display: none;
&[popover] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,7 @@ exports[`TextInput renders trailingAction icon button 1`] = `
/>
</svg>
</button>
<div
<span
aria-hidden={true}
className="c5"
data-direction="s"
Expand All @@ -2222,7 +2222,7 @@ exports[`TextInput renders trailingAction icon button 1`] = `
onMouseLeave={[Function]}
>
Icon label
</div>
</span>
</span>
</span>
`;
Expand Down Expand Up @@ -3194,7 +3194,7 @@ exports[`TextInput renders trailingAction text button with a tooltip 1`] = `
</span>
</span>
</button>
<div
<span
className="c6"
data-direction="s"
id=":r0:"
Expand All @@ -3203,7 +3203,7 @@ exports[`TextInput renders trailingAction text button with a tooltip 1`] = `
role="tooltip"
>
Clear input
</div>
</span>
</span>
</span>
`;
Expand Down
Loading