Skip to content

Commit

Permalink
wip: test long press
Browse files Browse the repository at this point in the history
  • Loading branch information
susiekims committed Dec 5, 2024
1 parent e14c814 commit b037d60
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function TooltipWrapperRaw(props: BaseProps) {
xScale,
yScale,
} = props;
const {scrollContainer, isTouchDevice} = useChartContext();
const {scrollContainer, isTouchDevice, containerBounds} = useChartContext();
const [position, setPosition] = useState<TooltipPosition>({
x: 0,
y: 0,
Expand Down Expand Up @@ -92,13 +92,14 @@ function TooltipWrapperRaw(props: BaseProps) {
event?: MouseEvent | TouchEvent;
index?: number;
}) => {
const containerBounds = {
x: parentElement?.getBoundingClientRect().x ?? 0,
y: Number(parentElement?.getBoundingClientRect().y ?? 0),
// + Number(scrollContainer?.scrollTop ?? 0),
width: parentElement?.getBoundingClientRect().width ?? 0,
height: parentElement?.getBoundingClientRect().height ?? 0,
};
// const containerBounds = {
// x: parentElement?.getBoundingClientRect().x ?? 0,
// y: Number(parentElement?.getBoundingClientRect().y ?? 0),
// // + Number(scrollContainer?.scrollTop ?? 0),
// width: parentElement?.getBoundingClientRect().width ?? 0,
// height: parentElement?.getBoundingClientRect().height ?? 0,
// };

switch (chartType) {
case InternalChartType.Line:
return getLineChartTooltipPosition({
Expand Down

0 comments on commit b037d60

Please sign in to comment.