Fixed the bug 'onNodeDragStop' not getting triggered

Got rid of 'dragging' in the global node state
This commit is contained in:
Furkan Kalaycioglu
2022-04-27 20:37:59 +03:00
parent 73118c356c
commit f075e0742e
11 changed files with 41 additions and 75 deletions
+7 -6
View File
@@ -118,11 +118,12 @@ function useDrag({
dy: pos.y,
});
}
}
})
.on('end', (event) => {
if (isDragAllowedBySelector) {
onStop(event);
event.on('end', (event) => {
if (isDragAllowedBySelector) {
onStop(event);
}
});
}
})
.filter((event: any) => !event.ctrlKey && !event.button && !event.target.className.includes(noDragClassName));
@@ -134,7 +135,7 @@ function useDrag({
};
}
}
}, [disabled, noDragClassName, nodeId]);
}, [onStart, onDrag, onStop, nodeRef, disabled, noDragClassName, handleSelector, nodeId]);
return null;
}