-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Components should be able to listen to tap events #436
Comments
+1 for a react-mobile build |
👍 for the add-on |
Edit: Better yet, just use injectTapEventPlugin. |
Basically, this is merge-in of https://github.com/zilverline/react-tap-event-plugin project, with incorporated @s0meone's fix for duplicate tap events. See also facebook#436
+1 |
please put the TapEventPlugin to the addons (exists in react-addons package) because we want to use Material-UI without nodejs build (we want to use scala js) but we can't compile the TapEventPlugin as standalone (if you compile it will include the react core)... |
+1 on comment above, I'm trying to use it without full nodejs stack and it's next to impossible to do without manual rewriting |
Tap is not a standard event, so we're probably going to rip it out of the core and let people detect taps in user land. The current implementation probably needs a bit of cleanup anyway, to detect things like double taps and long holds. Anyway, it's only 100 lines of code, available here: If someone wants to fix it up and publish it as an external library/module, that might be useful to people. |
@revolunet this works like a charm for me. It only handle simple tap. Double tap and long tap needs to be "calculated" by hand from this plugin. |
Any update on this? should we make use of the add-on or keep using https://github.com/zilverline/react-tap-event-plugin (once it's fixed for v15.0)? |
We don't have any supported solution for this. In general we don't support defining custom event types for the same reason we don't have any global configuration: because it makes interoperability difficult (if you develop a component that requires TapEventPlugin, it won't work for someone who doesn't load it). My best recommendation if you need this is to build a |
Thanks @spicyj for your quick update on this |
Seems that |
Hi guys. As posted #6221(comment)
|
Hi, I was using fastClick.js for touch based devices. Is it no more needed with react? Regards’
|
@markwain For many popular apps that relying on webview to show web pages in China, such as Weixin, Taobao, Alipay, they are still using the old UIWebView in iOS, which still has no love for removing tap delays for mobile pages, so the tap event is still necessary for several years... |
And I would think that older mobile devices that cannot be updated to the latest versions of Chrome/Safari would also need the plugin. |
facebook/react#436 (comment) indicates that it's no longer needed.
facebook/react#436 (comment) indicates that it's no longer needed.
facebook/react#436 (comment) indicates that it's no longer needed.
facebook/react#436 (comment) indicates that it's no longer needed.
facebook/react#436 (comment) indicates that it's no longer needed.
facebook/react#436 (comment) indicates that it's no longer needed.
facebook/react#436 (comment) indicates that it's no longer needed. * Remove react-tap-event-plugin from tests * Accordion: Use onClick instead of onTouchTap * Accordion Tests: Use Enzyme to simulate click * SectionNav: Use onClick instead of onTouchTap * Components: Replace more onTouchTap instances with onClick * Blocks: Replace more onTouchTap instances with onClick * DailyPost[Button]: Fix tests * Accordion Tests: Simplify some more * docs/react-component-unit-testing.md: Update interaction simulation example * Site Block: Drop old onClick prop, rename onTouchTap to onClick And modify all consumers to no longer rely on the old onClick prop.
See [#436](facebook/react#436 (comment)) and [react-tap-event-plugin readme](https://github.com/zilverline/react-tap-event-plugin) for more info.
I started a new thread to discuss how we can move the ecosystem to stop depending on As @sophiebits suggested, it sounds reasonable if folks who depend on it create a userland |
Question: how do you use touch events with React?
Answer:
This sucks. Instead I think we should just either put TapEventPlugin on addons or create a react-mobile build which does all this by default.
The text was updated successfully, but these errors were encountered: