aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index b87980397..4dd9979ea 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -677,8 +677,6 @@ export function StopEvent(e: React.PointerEvent | React.MouseEvent) {
e.preventDefault();
}
-
-
export function setupMoveUpEvents(
target: object,
e: React.PointerEvent,
@@ -694,7 +692,6 @@ export function setupMoveUpEvents(
(target as any)._lastTap = Date.now();
(target as any)._downX = (target as any)._lastX = e.clientX;
(target as any)._downY = (target as any)._lastY = e.clientY;
- (target as any)._noClick = false;
const _moveEvent = (e: PointerEvent): void => {
if (Math.abs(e.clientX - (target as any)._downX) > Utils.DRAG_THRESHOLD || Math.abs(e.clientY - (target as any)._downY) > Utils.DRAG_THRESHOLD) {
@@ -726,20 +723,17 @@ export function setupMoveUpEvents(
clearTimeout((target as any)._doubleTime);
(target as any)._doubleTime = undefined;
}
- (target as any)._noClick = clickEvent(e, (target as any)._doubleTap);
+ clickEvent(e, (target as any)._doubleTap);
}
document.removeEventListener("pointermove", _moveEvent);
document.removeEventListener("pointerup", _upEvent);
};
- const _clickEvent = (e: MouseEvent): void => {
- if ((target as any)._noClick) e.stopPropagation();
- document.removeEventListener("click", _clickEvent, true);
- }
if (stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
+ document.removeEventListener("pointermove", _moveEvent);
+ document.removeEventListener("pointerup", _upEvent);
document.addEventListener("pointermove", _moveEvent);
document.addEventListener("pointerup", _upEvent);
- document.addEventListener("click", _clickEvent, true);
} \ No newline at end of file