From c13ee62b84693346e28741d7f016c6700a2c27d4 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Thu, 28 Dec 2023 22:30:12 -0500 Subject: Add explicit passive option to touchstart event (#480) --- ext/js/display/display-resizer.js | 2 +- ext/js/language/text-scanner.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/js') diff --git a/ext/js/display/display-resizer.js b/ext/js/display/display-resizer.js index 8ce7e91a..794398b8 100644 --- a/ext/js/display/display-resizer.js +++ b/ext/js/display/display-resizer.js @@ -45,7 +45,7 @@ export class DisplayResizer { if (this._handle === null) { return; } this._handle.addEventListener('mousedown', this._onFrameResizerMouseDown.bind(this), false); - this._handle.addEventListener('touchstart', this._onFrameResizerTouchStart.bind(this), false); + this._handle.addEventListener('touchstart', this._onFrameResizerTouchStart.bind(this), {passive: false, capture: false}); } // Private diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index 9c254e44..aed431d3 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -1099,7 +1099,7 @@ export class TextScanner extends EventDispatcher { _getTouchEventListeners(capture) { return [ [this._node, 'auxclick', this._onAuxClick.bind(this), capture], - [this._node, 'touchstart', this._onTouchStart.bind(this), capture], + [this._node, 'touchstart', this._onTouchStart.bind(this), {passive: true, capture}], [this._node, 'touchend', this._onTouchEnd.bind(this), capture], [this._node, 'touchcancel', this._onTouchCancel.bind(this), capture], [this._node, 'touchmove', this._onTouchMove.bind(this), {passive: false, capture}], @@ -1130,7 +1130,7 @@ export class TextScanner extends EventDispatcher { if (documentElement !== null) { entries.push([documentElement, 'mousedown', this._onSearchClickMouseDown.bind(this), capture]); if (this._touchInputEnabled) { - entries.push([documentElement, 'touchstart', this._onSearchClickTouchStart.bind(this), capture]); + entries.push([documentElement, 'touchstart', this._onSearchClickTouchStart.bind(this), {passive: true, capture}]); } } return entries; -- cgit v1.2.3