I have a list of items. I want to be able to handle both an onClick and onLongPress events. For this purpose, I am using this hook here.
My issue is that on mobile when you start to press on the item, but them move your finger out of the "hitbox" (finger no longer on the item), this will still trigger a onLongPress event. Expected behaviour is that the user should keep their finger on the item when long pressing, and only then should the event trigger.
I found this library which doesn't have this issue but ONLY works on mobile, and I'm trying to make my app compatible with all platforms, including the browser (as a PWA): this one
Any sort of advice on how to move forward would be greatly appreciated.