minwork / use-long-press

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

Moving scrollbar doesn't triggers cancel #46

Closed zRafaF closed 1 year ago

zRafaF commented 1 year ago

Pressing and scrolling a scrollbar present inside the component doesn't cancel the action, even with cancelOnMovement set to true.

I'm running:

A possible solution would be to use onScrollCapture to call the cancel. At least thats what I used for my workaround.

minwork commented 1 year ago

Hey, that's a very interesting edge case, thank you for your report and suggested solution.

github-actions[bot] commented 1 year 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 1 year ago

Hey, it is the same case as in #48 which will be addressed in v3. See this comment for more details

minwork commented 1 year ago

@ZRafaF Hey, I've addressed this issue in use-long-press@3.0.0-rc.1, can you try it out and confirm if that resolves your problem? Migration guide to v3 can be found here

minwork commented 1 year ago

Version 3 which addresses this issue is now available at use-long-press@latest