diff options
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 8 |
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); |