Skip to content

Commit

Permalink
make TooltipWithBounds API match that of Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisja committed May 19, 2020
1 parent 806fbf2 commit 70be7a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/vx-tooltip/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ component (i.e., ...restProps):
| offsetRight | number | 10 | Vertical offset of the tooltip from the passed `top` value, functions as a vertical padding. |
| style | object | -- | Sets / overrides any styles on the tooltip container (including top and left) |
| children | node | -- | Sets the children of the tooltip, i.e., the actual content |
| unstyled | bool | true | Whether the tooltip should render with default styles or not |
| unstyled | bool | true | Whether the tooltip should use styles from the style prop or not |

Note that this component is positioned using a `transform`, so overriding `left` and `top` via
styles may have no effect.
Expand Down
5 changes: 2 additions & 3 deletions packages/vx-tooltip/src/tooltips/TooltipWithBounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function TooltipWithBounds({
parentRect,
getRects,
children,
style,
style = defaultStyles,
unstyled,
...otherProps
}: Props) {
Expand All @@ -60,8 +60,7 @@ function TooltipWithBounds({
style={{
top: 0,
transform: `translate(${left}px, ${top}px)`,
...style,
...(!unstyled && defaultStyles),
...(!unstyled && style),
}}
{...otherProps}
>
Expand Down

0 comments on commit 70be7a4

Please sign in to comment.