feat(props): add onPaneContextMenu

This commit is contained in:
Nate Amack
2020-08-04 17:12:42 -06:00
parent 09fee4c6ea
commit 93aa5c96ca
3 changed files with 12 additions and 1 deletions
+3
View File
@@ -51,6 +51,7 @@ export interface ReactFlowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
onMoveEnd?: (flowTransform?: FlowTransform) => void;
onSelectionChange?: (elements: Elements | null) => void;
onPaneClick?: () => void;
onPaneContextMenu?: (evt: MouseEvent) => void;
nodeTypes: NodeTypesType;
edgeTypes: EdgeTypesType;
connectionLineType: ConnectionLineType;
@@ -119,6 +120,7 @@ const ReactFlow = ({
zoomOnDoubleClick,
paneMoveable,
onPaneClick,
onPaneContextMenu,
}: ReactFlowProps) => {
const nodeTypesParsed = useMemo(() => createNodeTypes(nodeTypes), []);
const edgeTypesParsed = useMemo(() => createEdgeTypes(edgeTypes), []);
@@ -167,6 +169,7 @@ const ReactFlow = ({
zoomOnDoubleClick={zoomOnDoubleClick}
paneMoveable={paneMoveable}
onPaneClick={onPaneClick}
onPaneContextMenu={onPaneContextMenu}
/>
{onSelectionChange && <SelectionListener onSelectionChange={onSelectionChange} />}
{children}