From 83930a4bc704e877d6692a70ecae5346bcc7a1bc Mon Sep 17 00:00:00 2001 From: Khai Truong Date: Mon, 11 Nov 2024 21:41:56 +0700 Subject: [PATCH] touch tap invalidation when touch move --- ext/js/language/text-scanner.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index 001040b48..fd7ff24a8 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -929,6 +929,7 @@ export class TextScanner extends EventDispatcher { if (!this._preventScroll || !e.cancelable) { return; } + this._touchTapValid = false; const inputInfo = this._getMatchingInputGroupFromEvent('touch', 'touchMove', e); if (inputInfo === null || !(inputInfo.input !== null && inputInfo.input.scanOnTouchMove)) { return; } @@ -961,7 +962,9 @@ export class TextScanner extends EventDispatcher { /** * @param {PointerEvent} e */ - _onTouchMovePreventScroll(e) { + _onTouchMove(e) { + this._touchTapValid = false; + if (!this._preventScroll) { return; } if (e.cancelable) { @@ -1091,7 +1094,7 @@ export class TextScanner extends EventDispatcher { [this._node, 'pointercancel', this._onPointerCancel.bind(this), capture], [this._node, 'pointerout', this._onPointerOut.bind(this), capture], [this._node, 'mousedown', this._onMouseDown.bind(this), capture], - [this._node, 'touchmove', this._onTouchMovePreventScroll.bind(this), {passive: false, capture}], + [this._node, 'touchmove', this._onTouchMove.bind(this), {passive: false, capture}], [this._node, 'touchend', this._onTouchEnd.bind(this), capture], [this._node, 'auxclick', this._onAuxClick.bind(this), capture], [this._node, 'contextmenu', this._onContextMenu.bind(this), capture],