diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index 277740274..71c623abb 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -319,9 +319,9 @@ export default function Page({ ); // Calculate the position where the node should be created - const position = reactFlowInstance!.project({ - x: event.clientX - reactflowBounds!.left, - y: event.clientY - reactflowBounds!.top, + const position = reactFlowInstance!.screenToFlowPosition({ + x: event.clientX, + y: event.clientY }); // Generate a unique node ID