Skip to content

Commit

Permalink
fix: arrow was missing when interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed May 8, 2024
1 parent 49b3c67 commit ac69cb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/tooltip-interactive-arrow-react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cypress-design/react-tooltip": patch
---

fix: arrow was missing when interactive
8 changes: 3 additions & 5 deletions components/Tooltip/react/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const Tooltip: React.FC<
fn: (obj) => obj,
}
: flip(),
offset(interactive ? 0 : 16),
offset(16),
arrow({ element: arrowRef, padding: 24 }),
shift({ padding: 16 }),
],
Expand Down Expand Up @@ -200,10 +200,8 @@ export const Tooltip: React.FC<
placementSide === 'bottom' || color === 'dark'
? 'drop-shadow(0 1px 1px rgba(225, 227, 237, .3))'
: 'drop-shadow(0 1px 1px rgba(225, 227, 237, .8))',
[arrowXRule]: `${arrowX ?? (interactive ? 0 : -16)}px`,
[arrowYRule]: `${
arrowY ? arrowY + 6 : interactive ? 6 : -10
}px`,
[arrowXRule]: `${arrowX ?? -16}px`,
[arrowYRule]: `${arrowY ? arrowY + 6 : -10}px`,
}}
fill="none"
>
Expand Down

0 comments on commit ac69cb4

Please sign in to comment.