Skip to content

Commit

Permalink
fix: note/file list item longpress on iOS (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Sep 9, 2022
1 parent 1f27f0f commit 1efc352
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/web/src/javascripts/Hooks/useLongPress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const useLongPressEvent = (

elementRef.current.addEventListener('pointerdown', createLongPressTimeout)
elementRef.current.addEventListener('pointercancel', clearLongPressTimeout)
elementRef.current.addEventListener('pointerup', clearLongPressTimeout)
}, [clearLongPressTimeout, createLongPressTimeout, elementRef])

const cleanupEvents = useCallback(() => {
Expand All @@ -45,6 +46,7 @@ export const useLongPressEvent = (

elementRef.current.removeEventListener('pointerdown', createLongPressTimeout)
elementRef.current.removeEventListener('pointercancel', clearLongPressTimeout)
elementRef.current.removeEventListener('pointerup', clearLongPressTimeout)
}, [clearLongPressTimeout, createLongPressTimeout, elementRef])

const memoizedReturn = useMemo(
Expand Down

0 comments on commit 1efc352

Please sign in to comment.