Perf optimization

This commit is contained in:
thepaperpilot 2024-03-03 22:17:16 -06:00
parent aca56f6af6
commit 3fd8375031

View file

@ -160,7 +160,7 @@ export function setupDraggableNode<T>(options: {
},
drag: function (e: MouseEvent | TouchEvent) {
const panZoomInstance = options.board.value?.panZoomInstance as PanZoom | undefined;
if (panZoomInstance == null) {
if (panZoomInstance == null || nodeBeingDragged.value == null) {
return;
}
@ -199,10 +199,8 @@ export function setupDraggableNode<T>(options: {
hasDragged.value = true;
}
if (nodeBeingDragged.value != null) {
e.preventDefault();
e.stopPropagation();
}
e.preventDefault();
e.stopPropagation();
}
};
return result;