Skip to content

Commit

Permalink
fix: portal tooltips by default
Browse files Browse the repository at this point in the history
  • Loading branch information
asharonbaltazar committed Jan 9, 2025
1 parent 87fb50b commit da09d45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/client/src/common/components/ui/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,24 @@ export interface TooltipProps extends ChakraTooltip.RootProps {
}

export const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(props, ref) {
const { showArrow, children, disabled, portalled, content, contentProps, portalRef, ...rest } = props;
const {
showArrow,
children,
disabled,
portalled = true,
lazyMount = true,
unmountOnExit = true,
content,
contentProps,
portalRef,
...rest
} = props;

// eslint-disable-next-line -- we need to return children in Fragment
if (disabled) return <>{children}</>;

return (
<ChakraTooltip.Root {...rest}>
<ChakraTooltip.Root lazyMount={lazyMount} unmountOnExit={unmountOnExit} {...rest}>
<ChakraTooltip.Trigger asChild>{children}</ChakraTooltip.Trigger>
<Portal disabled={!portalled} container={portalRef}>
<ChakraTooltip.Positioner>
Expand Down
1 change: 1 addition & 0 deletions apps/client/src/theme/ontimeTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const ontimeTooltipRecipe = defineSlotRecipe({
backgroundColor: '#2d2d2d', // $gray-1100
color: '#ececec', // $gray-100
padding: '2px 8px',
fontSize: 'sm',
},
},
});

0 comments on commit da09d45

Please sign in to comment.