Skip to content

Commit cad1fac

Browse files
author
昔梦
committed
fix:修复复制节点影响onblur函数使用问题
1 parent 17d2cb4 commit cad1fac

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/x-flow/src/XFlow.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const XFlow: FC<FlowProps> = memo(props => {
129129
if ((e.key === 's' || e.key === 'S') && (e.ctrlKey || e.metaKey))
130130
e.preventDefault();
131131
if ((e.key === 'c' || e.key === 'C') && (e.ctrlKey || e.metaKey)) {
132+
132133
const latestNodes = storeApi.getState().nodes;
133134
let isNodeCopyEvent = false;
134135
if (e.target instanceof HTMLElement) {
@@ -147,7 +148,6 @@ const XFlow: FC<FlowProps> = memo(props => {
147148
}
148149
}
149150
const selectedNode = latestNodes?.find(node => node.selected);
150-
151151
if (isNodeCopyEvent && selectedNode?.id) {
152152
const nodeType = selectedNode?.data?._nodeType;
153153
if (isString(nodeType) && nodeType) {
@@ -334,9 +334,6 @@ const XFlow: FC<FlowProps> = memo(props => {
334334
id="xflow-container"
335335
ref={workflowContainerRef}
336336
tabIndex={0}
337-
onMouseDown={() => {
338-
workflowContainerRef.current?.focus();
339-
}}
340337
>
341338
<ReactFlow
342339
panOnDrag={panOnDrag}

0 commit comments

Comments
 (0)