Skip to content

Commit

Permalink
Add explicit passive option to touchstart event
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread committed Dec 28, 2023
1 parent 8d5d215 commit a77d4c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ext/js/display/display-resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ext/js/language/text-scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}],
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a77d4c4

Please sign in to comment.