We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63b3b39 commit 748ca44Copy full SHA for 748ca44
src/hooks/useMobileTouchMove.ts
@@ -49,13 +49,16 @@ export default function useMobileTouchMove(
49
const onTouchStart = (e: TouchEvent) => {
50
cleanUpEvents();
51
52
+ if (e.touches.length === 1) {
53
+ elementRef.current = e.target as HTMLElement;
54
+ elementRef.current.addEventListener('touchend', onTouchEnd);
55
+ }
56
+
57
if (e.touches.length === 1 && !touchedRef.current) {
58
touchedRef.current = true;
59
touchYRef.current = Math.ceil(e.touches[0].pageY);
60
- elementRef.current = e.target as HTMLElement;
61
elementRef.current.addEventListener('touchmove', onTouchMove);
- elementRef.current.addEventListener('touchend', onTouchEnd);
62
}
63
};
64
0 commit comments