Skip to content

Commit

Permalink
fix: update tooltip on marker position change
Browse files Browse the repository at this point in the history
  • Loading branch information
dackmin committed Jul 21, 2023
1 parent 270c35c commit 696865e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/react-d3-plugin/lib/Marker/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
import {
forwardRef,
useEffect,
useImperativeHandle,
useMemo,
useRef,
} from 'react';
import { Tooltip, classNames } from '@junipero/react';
import PropTypes from 'prop-types';

Expand Down Expand Up @@ -60,6 +66,10 @@ const Marker = forwardRef(({
isJunipero: true,
}));

useEffect(() => {
tooltipRef.current?.update?.();
}, [x]);

if (!cursor) {
return null;
}
Expand Down

0 comments on commit 696865e

Please sign in to comment.