always pass current pointer position to connection
This commit is contained in:
@@ -69,7 +69,7 @@ const ConnectionLine = <NodeType extends Node = Node>({
|
||||
CustomComponent,
|
||||
isValid,
|
||||
}: ConnectionLineProps<NodeType>) => {
|
||||
const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition } =
|
||||
const { inProgress, from, fromNode, fromHandle, fromPosition, to, toNode, toHandle, toPosition, pointer } =
|
||||
useConnection<NodeType>();
|
||||
|
||||
if (!inProgress) {
|
||||
@@ -92,6 +92,7 @@ const ConnectionLine = <NodeType extends Node = Node>({
|
||||
connectionStatus={getConnectionStatus(isValid)}
|
||||
toNode={toNode}
|
||||
toHandle={toHandle}
|
||||
pointer={pointer}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import type {
|
||||
OnError,
|
||||
OnReconnect,
|
||||
FinalConnectionState,
|
||||
XYPosition,
|
||||
} from '@xyflow/system';
|
||||
|
||||
import { EdgeTypes, InternalNode, Node } from '.';
|
||||
@@ -279,6 +280,7 @@ export type ConnectionLineComponentProps<NodeType extends Node = Node> = {
|
||||
connectionStatus: 'valid' | 'invalid' | null;
|
||||
toNode: InternalNode<NodeType> | null;
|
||||
toHandle: Handle | null;
|
||||
pointer: XYPosition;
|
||||
};
|
||||
|
||||
export type ConnectionLineComponent<NodeType extends Node = Node> = ComponentType<
|
||||
|
||||
Reference in New Issue
Block a user