{"id":14385077,"url":"https://github.com/zilverline/react-tap-event-plugin","last_synced_at":"2025-08-23T18:31:31.547Z","repository":{"id":20083059,"uuid":"23352114","full_name":"zilverline/react-tap-event-plugin","owner":"zilverline","description":"Instant TapEvents for React","archived":false,"fork":true,"pushed_at":"2018-05-29T13:30:55.000Z","size":32810,"stargazers_count":1057,"open_issues_count":42,"forks_count":105,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-08-10T20:55:12.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://facebook.github.io/react/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"facebook/react","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zilverline.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-08-26T13:11:29.000Z","updated_at":"2025-07-20T04:49:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zilverline/react-tap-event-plugin","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/zilverline/react-tap-event-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilverline%2Freact-tap-event-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilverline%2Freact-tap-event-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilverline%2Freact-tap-event-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilverline%2Freact-tap-event-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zilverline","download_url":"https://codeload.github.com/zilverline/react-tap-event-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zilverline%2Freact-tap-event-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271762964,"owners_count":24816843,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-28T18:01:55.890Z","updated_at":"2025-08-23T18:31:31.239Z","avatar_url":"https://github.com/zilverline.png","language":"JavaScript","readme":"# DEPRECATED\n\nReact 16.4 removes a lot of internals ([#121](https://github.com/zilverline/react-tap-event-plugin/issues/121)) this plugin depends on and will break the plugin.\n\nSince the problem it solves [has been fixed](https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away) in most browsers by now you should migrate away from this plugin.\n\n---\n\n# Introduction\nYou've probably heard of [iOS's dreaded 300ms tap delay](http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away).  React's `onClick` attribute falls prey to it.  ~~Facebook's working on a solution in the form of `TapEventPlugin`, but it [won't be made available](https://github.com/facebook/react/issues/436) [until 1.0](https://github.com/facebook/react/pull/1170).~~\n\n~~If you're reading this, you're probably working on a project that can't wait until they figure out how they want to publish it.  This repo is for you.~~\n\n~~When Facebook solves [#436](https://github.com/facebook/react/issues/436) and [#1170](https://github.com/facebook/react/pull/1170), this repo will disappear.~~\n\nFacebook is not planning on supporting tap events ([#436](https://github.com/facebook/react/issues/436#issuecomment-207624448)) because browsers are fixing/removing the click delay. Unfortunately it will take a lot of time before all mobile browsers (including iOS' UIWebView) will and can be updated. \n\nVerify if you need this plugin for the browsers you need to support.\n\n## Installation\n\nCompatible with React \u003e= 16.0 \u0026\u0026 \u003c 16.4:\n```sh\n$ npm i --save react-tap-event-plugin\n```\n\nCompatible with React \u003e= 15.4 \u0026\u0026 \u003c 16.0:\n```sh\n$ npm i --save react-tap-event-plugin@2.0.1\n```\n\nCompatible with React \u003e 0.14 \u0026\u0026 \u003c 15.4:\n```sh\n$ npm i --save react-tap-event-plugin@1.0.0\n```\n\nCompatible with React \u003c= 0.14:\n```sh\n$ npm i --save react-tap-event-plugin@0.2.2\n```\n\n## Usage\n\n```js\nvar injectTapEventPlugin = require(\"react-tap-event-plugin\");\ninjectTapEventPlugin();\n```\n\n## Example\n\nSee demo project for a complete working example.\n\n```js\nvar React = require(\"react\");\nvar ReactDOM = require(\"react-dom\");\ninjectTapEventPlugin = require(\"react-tap-event-plugin\");\ninjectTapEventPlugin();\n\nvar Main = React.createClass({\n  render: function() {\n    return (\n      \u003ca\n        href=\"#\"\n        onTouchTap={this.handleTouchTap}\n        onClick={this.handleClick}\u003e\n        Tap Me\n      \u003c/a\u003e\n    );\n  },\n\n  handleClick: function(e) {\n    console.log(\"click\", e);\n  },\n\n  handleTouchTap: function(e) {\n    console.log(\"touchTap\", e);\n  }\n});\n\nReactDOM.render(\u003cMain /\u003e, document.getElementById(\"container\"));\n```\n\n### Ignoring ghost clicks\n\nWhen a tap happens, the browser sends a `touchstart` and `touchend`, and then\n300ms later, a `click` event. This plugin ignores the click event if it has\nbeen immediately preceeded by a touch event (within 750ms of the last touch\nevent).\n\nOccasionally, there may be times when the 750ms threshold is exceeded due to\nslow rendering or garbage collection, and this causes the dreaded ghost click.\n\nThe 750ms threshold is pretty good, but sometimes you might want to override\nthat behaviour. You can do this by supplying your own `shouldRejectClick`\nfunction when you inject the plugin.\n\nThe following example will simply reject all click events, which you might\nwant to do if you are always using `onTouchTap` and only building for touch\ndevices:\n\n```js\nvar React = require('react'),\ninjectTapEventPlugin = require(\"react-tap-event-plugin\");\ninjectTapEventPlugin({\n  shouldRejectClick: function (lastTouchEventTimestamp, clickEventTimestamp) {\n    return true;\n  }\n});\n```\n\n## Build standalone version\n\nUse the demo project and it's README instructions to build a version of React with the tap event plugin included.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilverline%2Freact-tap-event-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzilverline%2Freact-tap-event-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzilverline%2Freact-tap-event-plugin/lists"}