From 995aadb020b91eee2a659f6d86c8f600f822775f Mon Sep 17 00:00:00 2001 From: Amirreza Zarkesh <56929398+ARZarkesh@users.noreply.github.com> Date: Tue, 18 Apr 2023 15:52:59 +0330 Subject: [PATCH] fix(useSwipe): ignore multiple touches (#2994) --- packages/core/useSwipe/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/useSwipe/index.ts b/packages/core/useSwipe/index.ts index 78808bb2ad8..abd20b5bd66 100644 --- a/packages/core/useSwipe/index.ts +++ b/packages/core/useSwipe/index.ts @@ -126,6 +126,8 @@ export function useSwipe( const stops = [ useEventListener(target, 'touchstart', (e: TouchEvent) => { + if (e.touches.length !== 1) + return if (listenerOptions.capture && !listenerOptions.passive) e.preventDefault() const [x, y] = getTouchEventCoords(e)