minwork / use-long-press

React hook for detecting click (or tap) and hold event
MIT License
120 stars 12 forks source link

onCancel from touchmove with cancelOnMovement set to true #20

Closed hburrows closed 2 years ago

hburrows commented 2 years ago

Thank you for the nice module. Good work.

Is there a good or recommended way to determine if onCancel is getting called due to movement when cancelOnMovement: true ? I need different behavior depending on whether the user is clicking or scrolling and I can't find a good (easy) solution. I'm thinking maybe I can check event.type === 'touchmove' but I'm hoping maybe state is maintained that will indicate "reason" for onCancel getting called. Thanks!!

minwork commented 2 years ago

Hey, I will address it along with #17 so there will be a additional info object passed to callbacks which will have an information of cancellation context

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

minwork commented 2 years ago

@hburrows This case will be addressed in v2 https://github.com/minwork/use-long-press/pull/23