Skip to content

Commit 5cde0a6

Browse files
authored
fix: resolve passive warning (#723)
1 parent 0e80879 commit 5cde0a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/hooks/useTouchMove.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ export default function useTouchMove(
124124
}
125125

126126
document.addEventListener('touchmove', onProxyTouchMove, { passive: false });
127-
document.addEventListener('touchend', onProxyTouchEnd, { passive: false });
127+
document.addEventListener('touchend', onProxyTouchEnd, { passive: true });
128128

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

133133
return () => {
134134
document.removeEventListener('touchmove', onProxyTouchMove);

0 commit comments

Comments
 (0)