fix: swipe gesture in library page should not unintentionally trigger tap (#396)

This commit is contained in:
Huang Xin
2025-02-18 13:29:07 +01:00
committed by GitHub
parent 8b2888af34
commit f9e9c90386
@@ -82,14 +82,6 @@ export const useLongPress = ({
const handlePointerUp = useCallback(
(e: React.PointerEvent) => {
// Special case: if we don't have a pointerId or startPos,
// this might be a post-context-menu tap
if (pointerId.current === null && startPosRef.current === null) {
onTap?.();
reset();
return;
}
if (e.pointerId !== pointerId.current) return;
if (!isLongPressTriggered.current && startPosRef.current) {