feat(nodes): add onDragStart handler #241

This commit is contained in:
moklick
2020-05-25 12:14:47 +02:00
parent 3936062e8d
commit 5049379e3b
7 changed files with 33 additions and 13 deletions
+4
View File
@@ -27,6 +27,7 @@ export interface ReactFlowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
elements: Elements;
onElementClick: (element: Node | Edge) => void;
onElementsRemove: (elements: Elements) => void;
onNodeDragStart: (node: Node) => void;
onNodeDragStop: (node: Node) => void;
onConnect: (connection: Edge | Connection) => void;
onLoad: OnLoadFunc;
@@ -59,6 +60,7 @@ const ReactFlow = ({
onMove,
onElementsRemove,
onConnect,
onNodeDragStart,
onNodeDragStop,
connectionLineType,
connectionLineStyle,
@@ -83,6 +85,7 @@ const ReactFlow = ({
onLoad={onLoad}
onMove={onMove}
onElementClick={onElementClick}
onNodeDragStart={onNodeDragStart}
onNodeDragStop={onNodeDragStop}
nodeTypes={nodeTypesParsed}
edgeTypes={edgeTypesParsed}
@@ -113,6 +116,7 @@ ReactFlow.displayName = 'ReactFlow';
ReactFlow.defaultProps = {
onElementClick: () => {},
onElementsRemove: () => {},
onNodeDragStart: () => {},
onNodeDragStop: () => {},
onConnect: () => {},
onLoad: () => {},