Merge branch 'main' into handle-lookup
This commit is contained in:
@@ -19,6 +19,8 @@ import {
|
||||
type HandleType,
|
||||
ConnectionMode,
|
||||
OnConnect,
|
||||
ConnectionState,
|
||||
Optional,
|
||||
} from '@xyflow/system';
|
||||
|
||||
import { useStore, useStoreApi } from '../../hooks/useStore';
|
||||
@@ -160,6 +162,7 @@ function HandleComponent(
|
||||
lib,
|
||||
rfId: flowId,
|
||||
nodeLookup,
|
||||
connection: connectionState,
|
||||
} = store.getState();
|
||||
|
||||
if (!nodeId || (!connectionClickStartHandle && !isConnectableStart)) {
|
||||
@@ -195,7 +198,10 @@ function HandleComponent(
|
||||
onConnectExtended(connection);
|
||||
}
|
||||
|
||||
onClickConnectEnd?.(event as unknown as MouseEvent);
|
||||
const connectionClone = structuredClone(connectionState) as Optional<ConnectionState, 'inProgress'>;
|
||||
delete connectionClone.inProgress;
|
||||
connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;
|
||||
onClickConnectEnd?.(event as unknown as MouseEvent, connectionClone);
|
||||
|
||||
store.setState({ connectionClickStartHandle: null });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user