Skip to content

Commit

Permalink
fix(use-long-press): Prevent casting falsy cancelOnMovement values to…
Browse files Browse the repository at this point in the history
… false
  • Loading branch information
minwork committed Aug 14, 2023
1 parent eaaee56 commit 8ff90a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/use-long-press/src/lib/use-long-press.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8ff90a1

Please sign in to comment.