Skip to content
Snippets Groups Projects

feat: use floating ui for node link tooltips

Merged Dennis Collaris requested to merge feat/nodelink-tooltips into main
1 file
+ 5
4
Compare changes
  • Side-by-side
  • Inline
@@ -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
Loading