Skip to content

Commit

Permalink
fix: resolve passive warning (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi authored Jun 12, 2024
1 parent 0e80879 commit 5cde0a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hooks/useTouchMove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ export default function useTouchMove(
}

document.addEventListener('touchmove', onProxyTouchMove, { passive: false });
document.addEventListener('touchend', onProxyTouchEnd, { passive: false });
document.addEventListener('touchend', onProxyTouchEnd, { passive: true });

// No need to clean up since element removed
ref.current.addEventListener('touchstart', onProxyTouchStart, { passive: false });
ref.current.addEventListener('wheel', onProxyWheel);
ref.current.addEventListener('touchstart', onProxyTouchStart, { passive: true });
ref.current.addEventListener('wheel', onProxyWheel, { passive: false });

return () => {
document.removeEventListener('touchmove', onProxyTouchMove);
Expand Down

0 comments on commit 5cde0a6

Please sign in to comment.