aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2021-01-27 00:00:39 -0500
committerusodhi <61431818+usodhi@users.noreply.github.com>2021-01-27 00:00:39 -0500
commite3db0536ad0086a328ee353be1c4dfd34ba03e02 (patch)
treee0479af2bde1e262d6749bf2c8758e920b0ee5a9 /src/Utils.ts
parent720958ce62337e719a77f2ce43847011a35b6d09 (diff)
parenteb2e88ef810eed9c1d31b3b2fdc3ba848f067c53 (diff)
merged
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index f160df6f7..3cf695a30 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -614,6 +614,10 @@ export function setupMoveUpEvents(
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) {
+ if ((target as any)._doubleTime) {
+ clearTimeout((target as any)._doubleTime);
+ (target as any)._doubleTime = undefined;
+ }
if (moveEvent(e, [(target as any)._downX, (target as any)._downY],
[e.clientX - (target as any)._lastX, e.clientY - (target as any)._lastY])) {
document.removeEventListener("pointermove", _moveEvent);
@@ -630,6 +634,10 @@ export function setupMoveUpEvents(
(target as any)._lastTap = Date.now();
upEvent(e, [e.clientX - (target as any)._downX, e.clientY - (target as any)._downY]);
if (Math.abs(e.clientX - (target as any)._downX) < 4 && Math.abs(e.clientY - (target as any)._downY) < 4) {
+ if ((target as any)._doubleTime && (target as any)._doubleTap) {
+ clearTimeout((target as any)._doubleTime);
+ (target as any)._doubleTime = undefined;
+ }
clickEvent(e, (target as any)._doubleTap);
}
document.removeEventListener("pointermove", _moveEvent);