fix: note/file list item longpress on iOS (#1506)

This commit is contained in:
Aman Harwara
2022-09-09 12:16:15 +05:30
committed by GitHub
parent 1f27f0f790
commit 1efc352da5

View File

@@ -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(() => {
@@ -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(