Merge pull request #3478 from wbkd/react-flow-use-react-flow

useReactFlow improvements
This commit is contained in:
Moritz Klack
2023-10-05 18:55:03 +02:00
committed by GitHub
5 changed files with 47 additions and 4 deletions

View File

@@ -49,9 +49,9 @@ const DnDFlow = () => {
if (reactFlowInstance) {
const type = event.dataTransfer.getData('application/reactflow');
const position = reactFlowInstance.project({
const position = reactFlowInstance.screenToFlowCoordinate({
x: event.clientX,
y: event.clientY - 40,
y: event.clientY,
});
const newNode: Node = {
id: getId(),