-
Notifications
You must be signed in to change notification settings - Fork 41
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
Handle touch devices #4
Comments
This is much needed! |
-1 I think developers for major mobile browser vendors don't need touch events since click event can work without delay. To remove the 300-350ms tap delay, all you need is the following in the of your page:
Works fine on Android (stock, chrome, opera, firefox) browsers, iOS 9+ |
Thanks for the info @frontenddeveloping. My inclination is that mobile user agents should interpret taps as clicks natively which is why I'm hesitant to add a userland implementation for detecting taps. Unfortunately, that doesn't seem to be the case, most of the time. It turns out that, at least from my testing on mobile safari, the click event won't trigger if the element does not have I'm trying to figure out ways to get ios to register taps as clicks without |
@davidtheclark What solution did you end up with for supporting touch devices? @kentor Any updates on how you are thinking about this now? |
@davidtheclark did you have to update |
@kentor Yeah, that's the idea. |
Since there isn't really a standard on what a "tap" is and I don't want to be opinionated on what constitutes as a tap, and I don't want to add that code to the library, I'll just add a note on the basically you can use something like this if ('ontouchstart' in document.documentElement) {
document.body.style.cursor = 'pointer';
} |
I would like to use this component but need it to handle touch events. This would add some code but increase the value. Essentially, I think we'd need to listen for adapt code from https://github.com/alexgibson/tap.js to listen for touchstart, determine whether the action is a scroll or a "tap", and respond to taps.
Are you open to a PR attempting to implement this?
The text was updated successfully, but these errors were encountered: