Skip to content

Commit 2a792ce

Browse files
fix: remove early return and use content to display or not the TooltipBody
1 parent 0b71493 commit 2a792ce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/components/Tooltip/Tooltip.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ const Tooltip: React.FC<TooltipProps> = ({
159159
const [triggerReference, setTriggerReference] = React.useState(undefined);
160160
const [contentReference, setContentReference] = React.useState(undefined);
161161

162-
if (!content) return children;
163162

164163
/**
165164
* Map the older placement values to Popper placement as we need to get the correct placement for the tooltip from the Popper library
@@ -204,7 +203,7 @@ const Tooltip: React.FC<TooltipProps> = ({
204203
onMouseOut: () => handleVisibilityChange(false),
205204
ref: setTriggerReference
206205
})}
207-
{isVisible && (
206+
{content && isVisible && (
208207
<TooltipBody
209208
ref={setContentReference}
210209
inverted={inverted}

0 commit comments

Comments
 (0)