iNoBounce
iNoBounce copied to clipboard
Dispatch click when touchmove was cancled
When touchmove event was cancled by evt.preventDefault() clicks don't work anymore with Apple Pencil. So I check if this happend and dispatch a new click-event on touchEnd.
This is tough for me to test as I don't have an Apple Pencil, but I will test the standard functionality and take your word on the pencil!
I'd like to get another set of eyes on this (or an Android tablet with a pencil) to see if this solution is cross-platform... Know anyone who can look at it @daniel-rabe ?
no sorry i know nobody with an android pencil
i changed my local solution again, to avoid unnessaccery clicks, by keeping track of the max-y-distance of the touchmove event, and forcing the click at the end only if the distance is < 100
I have the same problem with an ipad 2018 + pencil, I've made some tests with your code, it is now properly working (I can click on links/buttons with the pencil) but now when I click with the pencil it triggers the events twice. Probably stopPropagation() missing somewhere because a conflict with the click and the touchend... ?
Merging daniel-rabe solution with the latest (1.0.6) version seems to do the job (no more double calls). I still have the bad behavior (nothing happens) when clicking on a select (drop down list) with the pencil. But the regular buttons, links, ... are fine.