Perf optimization
This commit is contained in:
parent
6a17bbc29c
commit
5b33a0fceb
1 changed files with 3 additions and 5 deletions
|
@ -160,7 +160,7 @@ export function setupDraggableNode<T>(options: {
|
||||||
},
|
},
|
||||||
drag: function (e: MouseEvent | TouchEvent) {
|
drag: function (e: MouseEvent | TouchEvent) {
|
||||||
const panZoomInstance = options.board.value?.panZoomInstance as PanZoom | undefined;
|
const panZoomInstance = options.board.value?.panZoomInstance as PanZoom | undefined;
|
||||||
if (panZoomInstance == null) {
|
if (panZoomInstance == null || nodeBeingDragged.value == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,10 +199,8 @@ export function setupDraggableNode<T>(options: {
|
||||||
hasDragged.value = true;
|
hasDragged.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeBeingDragged.value != null) {
|
e.preventDefault();
|
||||||
e.preventDefault();
|
e.stopPropagation();
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue