Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

Dispatch click when touchmove was cancled - #39

Open
daniel-rabe wants to merge 2 commits into
lazd:masterfrom
daniel-rabe:master
Open

Dispatch click when touchmove was cancled#39
daniel-rabe wants to merge 2 commits into
lazd:masterfrom
daniel-rabe:master

Conversation

@daniel-rabe

Copy link
Copy Markdown

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.

@lazd

lazd commented Aug 8, 2017

Copy link
Copy Markdown
Owner

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

lazd commented Aug 8, 2017

Copy link
Copy Markdown
Owner

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 ?

@daniel-rabe

Copy link
Copy Markdown
Author

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

@spfmoby

spfmoby commented Jul 20, 2018

Copy link
Copy Markdown

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

spfmoby commented Jul 24, 2018

Copy link
Copy Markdown

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants