Skip to content

Commit

Permalink
tooltip fix
Browse files Browse the repository at this point in the history
  • Loading branch information
evc29 committed Jul 29, 2024
1 parent 7c8efcd commit 05580cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weng-lab/psychscreen-ui-components",
"description": "Typescript and Material UI based components used for psychSCREEN",
"author": "SCREEN Team @ UMass Chan Medical School",
"version": "0.9.3",
"version": "0.9.4",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
8 changes: 5 additions & 3 deletions src/components/Graph/Graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ const Graph: React.FC<GraphProps> = ({
return;
}

const containerRect = containerRef.current.getBoundingClientRect();
const coords = {
x: event.renderedPosition.x,
y: event.renderedPosition.y,
x: event.renderedPosition.x + containerRect.left,
y: event.renderedPosition.y + containerRect.top,
};

showTooltip({
Expand Down Expand Up @@ -505,9 +506,10 @@ const Graph: React.FC<GraphProps> = ({
<TooltipInPortal
style={{
...defaultStyles,
position: 'absolute',
zIndex: 1000,
backgroundColor: 'black',
color: 'white',
zIndex: 1000,
fontSize: '12px',
}}
key={Math.random()}
Expand Down

0 comments on commit 05580cd

Please sign in to comment.