iNoBounce icon indicating copy to clipboard operation
iNoBounce copied to clipboard

Dispatch click when touchmove was cancled

Open daniel-rabe opened this issue 7 years ago • 5 comments

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.

daniel-rabe avatar Aug 08 '17 08:08 daniel-rabe

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!

lazd avatar Aug 08 '17 16:08 lazd

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 ?

lazd avatar Aug 08 '17 17:08 lazd

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

daniel-rabe avatar Aug 09 '17 09:08 daniel-rabe

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... ?

spfmoby avatar Jul 20 '18 10:07 spfmoby

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.

spfmoby avatar Jul 24 '18 12:07 spfmoby