minwork / use-long-press

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

Click handler fires twice on the mobile device when the 'detect' is set to BOTH #3

Closed akosarch closed 3 years ago

akosarch commented 3 years ago

Steps to recreate:

Note: when 'detect' is set to 'MOUSE' or 'TOUCH' it works as expected; The bug occurs only when 'BOTH' is set. Video with the bug captured: https://www.dropbox.com/t/PEvlUSmBtV2hWlYc

minwork commented 3 years ago

Hello,

thanks for the report and an example.

I will investigate it.

minwork commented 3 years ago

@akosarch Fixed in v1.0.5

chriswardo commented 3 years ago

Hi! It seems like the onCancel (which I want to use as the onClick) event fires twice when just tapping using Chrome's device emulator (and the iOS Simulator).

As with the original bug report, this only happens when 'detect' is set to both.

minwork commented 3 years ago

Hey @chriswardo I will check it. In the meantime could you create separate issue for this case (preferably with reproducible example)?