From 8ff90a1419f594db27dd5f0a3f8a8c33e5739f05 Mon Sep 17 00:00:00 2001 From: minwork <20630104+minwork@users.noreply.github.com> Date: Mon, 14 Aug 2023 23:47:38 +0200 Subject: [PATCH] fix(use-long-press): Prevent casting falsy cancelOnMovement values to false --- packages/use-long-press/src/lib/use-long-press.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/use-long-press/src/lib/use-long-press.ts b/packages/use-long-press/src/lib/use-long-press.ts index 5e25994..dc44d07 100644 --- a/packages/use-long-press/src/lib/use-long-press.ts +++ b/packages/use-long-press/src/lib/use-long-press.ts @@ -209,7 +209,7 @@ export function useLongPress< // First call callback to allow modifying event position onMove?.(event, { context }); - if (cancelOnMovement && startPosition.current) { + if (cancelOnMovement !== false && startPosition.current) { const currentPosition = getCurrentPosition(event); if (currentPosition) {