Skip to content

Commit d4f24d6

Browse files
selfcontainedroboquat
authored andcommitted
Shift tip inside span to keep it from dissapearing
1 parent 3337d3d commit d4f24d6

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

components/dashboard/src/components/Tooltip.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ function Tooltip(props: TooltipProps) {
5050
<>
5151
<span onMouseLeave={handleMouseLeave} onMouseEnter={handleMouseEnter} ref={setTriggerEl}>
5252
{props.children}
53+
{expanded ? (
54+
<Portal>
55+
<div
56+
ref={setTooltipEl}
57+
style={styles.popper}
58+
className={
59+
`max-w-md z-50 py-1 px-2 bg-gray-900 text-gray-100 text-sm absolute flex flex-col border border-gray-200 dark:border-gray-800 rounded-md truncated ` +
60+
(props.allowWrap ? "whitespace-normal" : "whitespace-nowrap")
61+
}
62+
{...attributes.popper}
63+
>
64+
{props.content}
65+
</div>
66+
</Portal>
67+
) : null}
5368
</span>
54-
{expanded ? (
55-
<Portal>
56-
<div
57-
ref={setTooltipEl}
58-
style={styles.popper}
59-
className={
60-
`max-w-md z-50 py-1 px-2 bg-gray-900 text-gray-100 text-sm absolute flex flex-col border border-gray-200 dark:border-gray-800 rounded-md truncated ` +
61-
(props.allowWrap ? "whitespace-normal" : "whitespace-nowrap")
62-
}
63-
{...attributes.popper}
64-
>
65-
{props.content}
66-
</div>
67-
</Portal>
68-
) : null}
6969
</>
7070
);
7171
}

0 commit comments

Comments
 (0)