feat(props): add onEdgeUpdateEnd handler closes #1157

This commit is contained in:
moklick
2021-05-29 15:12:31 +02:00
parent f244e77b9e
commit 27e2781d8c
8 changed files with 54 additions and 25 deletions
+2
View File
@@ -51,6 +51,7 @@ const initialElements: Elements = [
const onLoad = (reactFlowInstance: OnLoadParams) => reactFlowInstance.fitView();
const onEdgeUpdateStart = (_: React.MouseEvent, edge: Edge) => console.log('start update', edge);
const onEdgeUpdateEnd = (_: MouseEvent, edge: Edge) => console.log('end update', edge);
const UpdatableEdge = () => {
const [elements, setElements] = useState<Elements>(initialElements);
@@ -68,6 +69,7 @@ const UpdatableEdge = () => {
onConnect={onConnect}
onEdgeUpdateStart={onEdgeUpdateStart}
onElementsRemove={onElementsRemove}
onEdgeUpdateEnd={onEdgeUpdateEnd}
>
<Controls />
</ReactFlow>