Skip to content

Commit

Permalink
fix(useSwipe): ignore multiple touches (#2996)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
ARZarkesh and antfu committed Apr 22, 2023
1 parent d4db0ad commit af3ca89
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/useSwipe/index.ts
Expand Up @@ -137,6 +137,8 @@ export function useSwipe(
}, listenerOptions),

useEventListener(target, 'touchmove', (e: TouchEvent) => {
if (e.touches.length !== 1)
return
const [x, y] = getTouchEventCoords(e)
updateCoordsEnd(x, y)
if (!isSwiping.value && isThresholdExceeded.value)
Expand Down

0 comments on commit af3ca89

Please sign in to comment.