{"id":19839958,"url":"https://github.com/alekseykulikov/touch-action","last_synced_at":"2025-05-01T19:30:32.827Z","repository":{"id":57378327,"uuid":"52004253","full_name":"alekseykulikov/touch-action","owner":"alekseykulikov","description":"Disable 300ms delay on mobile using CSS touch-action or asynchronously download FastClick as polyfill","archived":false,"fork":false,"pushed_at":"2016-02-22T02:21:17.000Z","size":11,"stargazers_count":116,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T16:13:23.630Z","etag":null,"topics":["css","fastclick","polyfill"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alekseykulikov.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-18T11:59:36.000Z","updated_at":"2024-08-30T21:58:20.000Z","dependencies_parsed_at":"2022-09-19T03:33:16.496Z","dependency_job_id":null,"html_url":"https://github.com/alekseykulikov/touch-action","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekseykulikov%2Ftouch-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekseykulikov%2Ftouch-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekseykulikov%2Ftouch-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekseykulikov%2Ftouch-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alekseykulikov","download_url":"https://codeload.github.com/alekseykulikov/touch-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251932543,"owners_count":21667162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","fastclick","polyfill"],"created_at":"2024-11-12T12:24:57.961Z","updated_at":"2025-05-01T19:30:32.370Z","avatar_url":"https://github.com/alekseykulikov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# touch-action\n\n\u003e Disable 300ms delay on mobile using CSS touch-action or asynchronously download FastClick as polyfill.\n\n[![](https://img.shields.io/npm/v/touch-action.svg)](https://npmjs.org/package/touch-action)\n\n[CSS touch-action property](http://caniuse.com/#search=touch-action) allows eliminate the 300ms delay between a physical tap and the firing of a click event on mobile browsers. It's supported by all major browsers including Safari 9.3.\nTherefore, there's no reason to always use [FastClick](https://github.com/ftlabs/fastclick) and include it to javascript bundle.\n\nThis library is just [17 lines of code](./index.js) and 14x smaller than FastClick (2.68Kb vs 0.2Kb). It checks support of CSS `touch-action`, and sets `touch-action: manipulation` to document body. When `touch-action` property is not supported, it asynchronously downloads [FastClick](https://github.com/ftlabs/fastclick) from CDN and use `FastClick.attach(document.body)` as polyfill.\n\nThis module is inspired by [gajus's gist](https://gist.github.com/gajus/bbf06ea2e37047b01e70).\n\n## Installation\n\n    npm install touch-action --save\n    bower install touch-action\n\nStandalone version available as [dist/touch-action.min.js](./dist/touch-action.min.js).\n\n```html\n\u003cscript src=\"touch-action.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003ewindow.touchAction()\u003c/script\u003e\n```\n\n## Example\n\n```js\nimport touchAction from 'touch-action'\n\n// use default behavior and download FastClick from CDN when needed\n// https://cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js\ntouchAction()\n\n// use your own copy of FastClick\ntouchAction({ src: '/assets/fastclick.min.js' })\n```\n\n## touchAction(opts)\n\nInit `touch-action` or download and attach `FastClick`.\n\nAvailable options:\n- `src` - custom path to fastclick (default: https://cdnjs.cloudflare.com/ajax/libs/fastclick/1.0.6/fastclick.min.js)\n- `val` - specify [custom](https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action) touch-action value, but be careful, since FastClick enables only `manipulation` (default: `manipulation`)\n\n## License\n\n[MIT]('./LICENSE')\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekseykulikov%2Ftouch-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekseykulikov%2Ftouch-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekseykulikov%2Ftouch-action/lists"}