Skip to content
Snippets Groups Projects
Commit 0f7f2872 authored by Dennis Collaris's avatar Dennis Collaris
Browse files

fix: ensure tooltip trigger element is absolutely positioned to not affect the scroll box

parent 591e1532
No related branches found
No related tags found
No related merge requests found
......@@ -119,11 +119,12 @@ export const TooltipTrigger = React.forwardRef<HTMLElement, React.HTMLProps<HTML
React.useEffect(() => {
if (x == null) return;
if (x && y) {
context.data.refs.reference.current.style.transform = `translate(${x}px, ${y}px)`;
if (x && y && context.data.refs.reference.current != null) {
const element = context.data.refs.reference.current as HTMLElement;
element.style.position = 'absolute';
element.style.transform = `translate(${x}px, ${y}px)`;
context.data.update();
}
context.data.update();
}, [x, y]);
// `asChild` allows the user to pass any element as the anchor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment