Skip to content

Commit c4d6f84

Browse files
committed
fix(component): fixed the tooltip position problem
1 parent a073d2a commit c4d6f84

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/headless/src/components/tooltip/tooltip.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const Tooltip = component$(
4040
return (
4141
<div>
4242
<div
43+
style={`width: max-content;`}
4344
ref={slotted}
4445
onMouseEnter$={() => showTooltip()}
4546
onMouseLeave$={() => hideTooltip()}
@@ -55,9 +56,10 @@ export const Tooltip = component$(
5556
{...props}
5657
style={`${
5758
isTooltipVisible.value ? 'display: block' : 'display: none'
58-
};
59+
};
60+
width: max-content;
5961
position: absolute;
60-
left: ${xSignal.value}px;
62+
left: ${xSignal.value}px;
6163
top: ${ySignal.value}px;`}
6264
>
6365
{message}

0 commit comments

Comments
 (0)