From 18c88042e9f39d4e96e9ffea2e0e697e2d4b9163 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 23 Aug 2021 03:38:23 +0300 Subject: [PATCH] [Perf] Touch listeners should be passive --- src/util/captureEvents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/captureEvents.ts b/src/util/captureEvents.ts index 277f92412..388592408 100644 --- a/src/util/captureEvents.ts +++ b/src/util/captureEvents.ts @@ -64,7 +64,7 @@ export function captureEvents(element: HTMLElement, options: CaptureOptions) { // We need to always listen on `touchstart` target: // https://stackoverflow.com/questions/33298828/touch-move-event-dont-fire-after-touch-start-target-is-removed const target = e.target as HTMLElement; - target.addEventListener('touchmove', onMove); + target.addEventListener('touchmove', onMove, { passive: true }); target.addEventListener('touchend', onRelease); target.addEventListener('touchcancel', onRelease);