Giter Club home page Giter Club logo

touch-action's People

Contributors

alekseykulikov avatar hakubo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hakubo jabez128

touch-action's Issues

Cool Script

I tried your implementation inside a scroll view and it worked really nice.

I didn't see much difference on a range slider inside a web app running on Android 8.2 on a Motorola G5.

Do you think you can improve it further?

Regards

2.0.0

Problem source

Mobile browsers have a gesture known as double tap to zoom, and to make double tap to zoom work, browsers don’t fire a click event (or the various mouse events) until ~300 milliseconds after the user taps the screen. Simply put, without a delay browsers cannot differentiate between a “click” and the first half of a double tap.

Existing solutions

https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay

FastClick (https://github.com/ftlabs/fastclick)

+ works everywhere - polyfilll
- applies to the whole page, blocks zoom
- additional 2.5 kb for every page, even on desktop

<meta name="viewport" content="width=device-width”>(https://twitter.com/jaffathecake/status/702854158878183425)

+ works iOS 9.3+ 
- hard to check native support
- requires polyfill as fallback
- does not work in IE

CSS touch-action: manipulation (https://github.com/alekseykulikov/touch-action)

+ works iOS 9.3+ and IE10 (ms-touch-action)
+ configurable
- works only with “clickable elements” (link, button)
- requires polyfill as fallback

Steps

button:not(.needsclick), a[href]:not(.needsclick) {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}
  • test on real devices (using saucelabs + delay detection)
  • ask for feedback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.