
FastClick
A small JavaScript library that removed the 300ms tap delay on old mobile browsers.
- Stars
- 18.5k
- Forks
- 3.1k
- Licence
- MIT
- Language
- HTML
- Last update
- 5.2 years ago
- Type
- Library
This repository is archived and no longer maintained.
What it is
FastClick is a JavaScript library that removed the roughly 300ms delay mobile browsers used to wait before firing a click after a tap. Developers attached it to a page so taps felt more responsive. The README notes that most modern mobile browsers, including Chrome and Safari, no longer have this delay, so the library now offers little benefit there and may introduce bugs.
- Attach FastClick to document.body on a legacy mobile web app to remove the tap delay
- Mark specific elements with the needsclick class so they keep native click behavior
- Load the library with AMD, CommonJS/Browserify, or a plain script tag
Great for
- Developers maintaining legacy web apps that must support older mobile browsers
- Teams who have measured a real tap delay on target devices and want to confirm the fix
- Developers working with Twitter Bootstrap 2.2.2 dropdowns on touch devices who need the needsclick workaround
Not ideal for
- New projects targeting modern Chrome or Safari, since the README says those browsers no longer have the 300ms delay and the library risks bugs
- Anyone who needs pinch zoom or accessibility-friendly behavior without first checking the viewport and touch-action alternatives described in the README
- Developers looking for an actively maintained project, since the repository is archived and last pushed in August 2021
How to get it
- 1
Install with a package manager
Install from npm
npm install fastclick - 2
Run it
- Include fastclick.js in your bundle or add a script tag pointing to it
- Wait for DOMContentLoaded in the page script
- Call FastClick.attach(document.body)
- 3
Get the most out of it
- Use the viewport meta tag with width=device-width to avoid the need for FastClick on Chrome Android 32+, as the README describes
- Use touch-action: manipulation on links and buttons to disable double-tap zoom in IE11+
- Add the needsclick class to elements that need a native click, such as focus triggers or Bootstrap dropdowns
Downloads
Strengths
- Simple to add: the README shows a short attach call on document.body
- Designed to avoid interfering with existing click logic, according to the README
- Supports a long list of older mobile browsers that the FT Web App was tested on
Trade-offs
- The README says modern mobile browsers no longer need it and it may introduce bugs
- The repository is archived and was last pushed in August 2021, so no future fixes are expected
- The README states there are no automated tests, only manual test cases
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.