feat(props): add nodeClickDistance

This commit is contained in:
moklick
2024-07-15 15:28:27 +02:00
parent edf7a8eec0
commit da35b9d7fb
16 changed files with 49 additions and 2 deletions
+3
View File
@@ -11,6 +11,7 @@ type UseDragParams = {
handleSelector?: string;
nodeId?: string;
isSelectable?: boolean;
nodeClickDistance?: number;
};
/**
@@ -25,6 +26,7 @@ export function useDrag({
handleSelector,
nodeId,
isSelectable,
nodeClickDistance,
}: UseDragParams) {
const store = useStoreApi();
const [dragging, setDragging] = useState<boolean>(false);
@@ -59,6 +61,7 @@ export function useDrag({
domNode: nodeRef.current,
isSelectable,
nodeId,
nodeClickDistance,
});
return () => {
xyDrag.current?.destroy();