diff --git a/lib/utils/gestures.html b/lib/utils/gestures.html index 85677dad4d..7ccc4ad6d8 100644 --- a/lib/utils/gestures.html +++ b/lib/utils/gestures.html @@ -913,14 +913,14 @@ }, /** * @this {GestureRecognizer} - * @param {Event} e - * @param {Function} preventer + * @param {Event | Touch} e + * @param {Event=} preventer */ forward: function(e, preventer) { let dx = Math.abs(e.clientX - this.info.x); let dy = Math.abs(e.clientY - this.info.y); // find original target from `preventer` for TouchEvents, or `e` for MouseEvents - let t = Gestures._findOriginalTarget(preventer || e); + let t = Gestures._findOriginalTarget(/** @type {Event} */(preventer || e)); // dx,dy can be NaN if `click` has been simulated and there was no `down` for `start` if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) { // prevent taps from being generated if an event has canceled them