Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchend event not triggered #5

Open
TheShellfishMeme opened this issue Mar 5, 2012 · 1 comment
Open

Touchend event not triggered #5

TheShellfishMeme opened this issue Mar 5, 2012 · 1 comment

Comments

@TheShellfishMeme
Copy link

When I try to use Touchy on my Transformer Prime, the touchend event is never triggered, unless I only do a simple click-like touch. Once I move the finger, the touch never ends and the hand grows more and more fingers the more touchstart events I trigger.

Using mouse simulation my code works fine though.

I've tried initializing Touchy with

Touchy(touchField, true, {
    one: function(hand, finger){
        console.log(hand.fingers.length);
    }
});           

to make sure that only one finger is used but that won't help either. The hand grows more and more fingers with every new touchstart and never is a touchend event triggered.

@TheShellfishMeme
Copy link
Author

Found the culprit. See http://code.google.com/p/android/issues/detail?id=19827 for related bug report.

Basically, touchstart, touchmove and touchend need to first call e.preventDefault(); or the following events will not be triggered. Once that line is added in the event handlers, everything works fine on android.

Note that this might introduce new bugs though, because the event propagation is canceled and thus, clickable things such as links in the touchy area don't react to clicks anymore.

For example, I use touchy to scroll a list of images. After adding aforementioned fix, scrolling works but clicking on the images does no longer work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant