Skip to content

Commit

Permalink
Reduce tooltip offset to match the first impl
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros committed Apr 12, 2024
1 parent e7a1ee8 commit a94c9fc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/Tooltip/__snapshots__/Tooltip.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Tooltip > opens tooltip on focus 1`] = `
class="_tooltip_9b26f8"
id=":ri:"
role="tooltip"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 8px);"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 6px);"
tabindex="-1"
>
<svg
Expand Down Expand Up @@ -94,7 +94,7 @@ exports[`Tooltip > opens tooltip on focus where trigger is non interactive 2`] =
class="_tooltip_9b26f8"
id=":ro:"
role="tooltip"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 8px);"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 6px);"
tabindex="-1"
>
<svg
Expand Down Expand Up @@ -195,7 +195,7 @@ exports[`Tooltip > renders default tooltip 1`] = `
class="_tooltip_9b26f8"
id=":rc:"
role="tooltip"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 8px);"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 6px);"
tabindex="-1"
>
<svg
Expand Down Expand Up @@ -360,7 +360,7 @@ exports[`Tooltip > renders with caption 2`] = `
class="_tooltip_9b26f8"
id=":r12:"
role="tooltip"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 8px);"
style="position: absolute; left: 0px; top: 0px; transform: translate(5px, 6px);"
tabindex="-1"
>
<svg
Expand Down
4 changes: 2 additions & 2 deletions src/components/Tooltip/useTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export function useTooltip({
onOpenChange: setOpen,
whileElementsMounted: autoUpdate,
middleware: [
// arrow height 6px + 2px padding
offset(8),
// arrow height 6px
offset(6),
flip({
crossAxis: placement.includes("-"),
fallbackAxisSideDirection: "start",
Expand Down

0 comments on commit a94c9fc

Please sign in to comment.