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

Touch event with scrolling #15

Closed
MalabarFront opened this issue Apr 10, 2013 · 9 comments
Closed

Touch event with scrolling #15

MalabarFront opened this issue Apr 10, 2013 · 9 comments

Comments

@MalabarFront
Copy link

As always, stellar work on this. One issue so far:

On touchscreens (tested on safari/chrome on iOS6), the menu toggle event fires as soon as your finger touches the toggle, not when it's lifted after a tap. So it essentially intercepts scrolling and turns the toggle into a dead area on the screen.

Cheers.

@arielsalminen
Copy link
Owner

This works as intended to provide as fast response time as possible.

It's up to the designer/developer to not put the toggle in a place where this functionality would cause harm to the user.

@MalabarFront
Copy link
Author

I disagree with your argument on this one. There's nowhere on the page where you could guarantee a user won't place their thumb to scroll and swipe, so the plugin firing events on touchstart, to me, is the source of the harm, not the placement of the toggle button.

There are ways to eliminate the 300ms delay without introducing this behaviour. As Google themselves say: "If the user touches down on the button and then drags the screen a bit and then invokes a touchend on the button then we should not fire a click." (Source: https://developers.google.com/mobile/articles/fast_buttons)

And Fastclick (https://github.com/ftlabs/fastclick) also avoids this problem.

Obviously this is your project, I'm just putting two pennies in as to what I think the sensible behaviour should be.

@arielsalminen arielsalminen reopened this Apr 10, 2013
@arielsalminen
Copy link
Owner

@MalabarFront I reopened the issue, maybe we can come up with a good solution to this :)

@cubiq
Copy link
Contributor

cubiq commented Apr 10, 2013

add a touchmove even and cancel the tap if it is fired (with a 5-10px threshold)

@arielsalminen
Copy link
Owner

@cubiq Sounds like a good and simple solution!

@arielsalminen
Copy link
Owner

I have a new version now coming which uses 10px threshold and triggers the menu open on touchend if there's no touchmove. Need just a bit more device testing before pushing to GitHub.

@challahan
Copy link

Any updates on this one? I'm having the same issue, as my menu is placed further down my page and gets triggered by accident when the user is scrolling.

@arielsalminen
Copy link
Owner

@challahan This issue is fixed in the latest release I just pushed.

@challahan
Copy link

You're awesome - thank you!

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

4 participants