Skip to content

Instantly share code, notes, and snippets.

@brianleejackson
Last active April 11, 2022 02:12
Show Gist options
  • Save brianleejackson/d9493229c168f2647ed9b8d45014bf4b to your computer and use it in GitHub Desktop.
Save brianleejackson/d9493229c168f2647ed9b8d45014bf4b to your computer and use it in GitHub Desktop.
FastClick Delay JS workaround for iOS double-click bug. As used here: https://perfmatters.io/docs/delay-javascript/
<script src="https://cdnjs.cloudflare.com/ajax/libs/fastclick/0.6.0/fastclick.min.js" integrity="sha512-oljyd1wg75alHReTpDvNIQ4Yj1wZwGxxZhJhId3vr2dKY+26/r/wmMrImwDgin03+7wxyhX+adOQB/2BTvO5tQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment