diff --git a/src/components/Handle/Handle.vue b/src/components/Handle/Handle.vue index 15013294..95b102a7 100644 --- a/src/components/Handle/Handle.vue +++ b/src/components/Handle/Handle.vue @@ -4,7 +4,7 @@ import { Position } from '../../types' import { NodeId } from '../../context' import type { HandleProps } from '../../types/handle' -const { id, hooks } = useVueFlow() +const { id, hooks, connectionStartHandle } = useVueFlow() const props = withDefaults(defineProps(), { type: 'source', position: 'top' as Position, @@ -13,11 +13,12 @@ const props = withDefaults(defineProps(), { const nodeId = inject(NodeId, '') -const handler = useHandle() +const { onMouseDown, onClick } = useHandle() const onMouseDownHandler = (event: MouseEvent) => - handler(event, props.id, nodeId, props.type === 'target', props.isValidConnection, undefined, (connection) => + onMouseDown(event, props.id ?? null, nodeId, props.type === 'target', props.isValidConnection, undefined, (connection) => hooks.value.connect.trigger(connection), ) +const onClickHandler = (event: MouseEvent) => onClick(event, props.id ?? null, nodeId, props.type, props.isValidConnection)