Skip to content

Commit 10b045c

Browse files
authored
Merge pull request #434
fix(22188): Prevent creation of dropped node when connecting * fix(22188): prevent creation of dropped node when connecting nodes
1 parent 0c03495 commit 10b045c

File tree

1 file changed

+10
-1
lines changed
  • hivemq-edge/src/frontend/src/extensions/datahub/components/pages

1 file changed

+10
-1
lines changed

hivemq-edge/src/frontend/src/extensions/datahub/components/pages/PolicyEditor.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ const PolicyEditor: FC = () => {
141141
[onAddNodes, onConnect, reactFlowInstance]
142142
)
143143

144+
const onConnectNodes = useCallback(
145+
(connection: Connection) => {
146+
edgeConnectStart.current = undefined
147+
onConnect(connection)
148+
},
149+
[onConnect]
150+
)
151+
144152
return (
145153
<>
146154
<ReactFlowProvider>
@@ -155,7 +163,8 @@ const PolicyEditor: FC = () => {
155163
// onEdgeUpdate={onEdgeUpdate}
156164
onConnectStart={onConnectStart}
157165
onConnectEnd={onConnectEnd}
158-
onConnect={onConnect}
166+
onConnect={onConnectNodes}
167+
connectionRadius={35}
159168
connectionLineComponent={isEditable ? ConnectionLine : undefined}
160169
onInit={setReactFlowInstance}
161170
fitView

0 commit comments

Comments
 (0)