Skip to content

Commit

Permalink
Resolve console errors from Tooltip component
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbegley committed Apr 14, 2024
1 parent 3135cf9 commit 51f8596
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/private/OverlayTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,27 @@ const TooltipTemplate = React.forwardRef(
style,
children,
arrowProps,
popper: _,
show: _2,
popper,
show,
hasDoneInitialMeasure,
...props
},
ref
) => {
const [primaryPlacement] = placement?.split('-') || [];
const bsDirection = getOverlayDirection(primaryPlacement);

const computedStyle = style;
if (show && !hasDoneInitialMeasure)
computedStyle = {
...style,
position: popper?.strategy,
top: '0',
left: '0',
opacity: '0',
pointerEvents: 'none'
};

const {
handleMouseOverTooltipContent,
handleMouseLeaveTooltipContent
Expand All @@ -89,7 +101,7 @@ const TooltipTemplate = React.forwardRef(
return (
<div
ref={ref}
style={style}
style={computedStyle}
role="tooltip"
x-placement={primaryPlacement}
className={classNames(
Expand Down

0 comments on commit 51f8596

Please sign in to comment.