diff --git a/src/hooks/useTrackpadGesture.ts b/src/hooks/useTrackpadGesture.ts index 66f801d8..5bcae723 100644 --- a/src/hooks/useTrackpadGesture.ts +++ b/src/hooks/useTrackpadGesture.ts @@ -1,4 +1,4 @@ -import { useRef, useState } from "react" +import { useEffect, useRef, useState } from "react" import { PINCH_THRESHOLD, TOUCH_MOVE_THRESHOLD, @@ -254,6 +254,14 @@ export const useTrackpadGesture = ( } } + useEffect(() => { + return () => { + if (draggingTimeout.current) { + clearTimeout(draggingTimeout.current) + } + } + }, []) + return { isTracking, handlers: {