-
Notifications
You must be signed in to change notification settings - Fork 46.2k
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
React 15-rc.1 regression: onTouchTap not working #6221
Comments
Someone proposed that onTouchTap might now be integrated. It's not |
Finally! Thanks for the heads up. I thought its MaterialUI. Will give it a try on React 14. |
I have now tested it with |
This is not a regression. If you look at the history of TapEventPlugin in the React codebase you will see that it was affected by one of the recent refactorings (this is internal code and we make no guarantees about the API stability). Specifically, 4a465fb and f470cb8 changed some of the arguments that were being passed. Since I’m closing this but please let us know if you have any other issues. Cheers! |
I didn't realize that TapEventPlugin was still maintained internally. What's the plan for unifying the two? React should support touch events out-of-the-box. If for some reason that's out-of-scope, can Facebook use/maintain the npm package, so we don't have two parallel copies of the same code? |
I don't think it's maintained per se. It's just that there was an internal refactoring that changed the argument order, and @soprano went through all matching call sites, changing them there, and it happened to include TapEventPlugin. We make no guarantees about it not being broken. I think we should remove it from the core source code. But yeah, this means that its maintainers will need to track changes to internal APIs. We don't have a better solution right now. Eventually we might expose event system officially as well as DOM configs but if addons taught us anything, it's that anything we expose creates a huge maintenance burden down the road which creates significant delays in development of React itself. So please excuse us that we don't have a good story around this right now. We are happy to discuss handling taps in a separate issue though so feel free to file it! Thanks. |
@gaearon is correct. To add to his comment, the plan is to rip it out of the core repository and have this handled in user land, as per: #436 (comment) |
Thanks guys. For some reason, I remembered touch events not being detected without TapEventPlugin being installed. I just tested it, and that is no longer the case. Since Chrome and Safari have both removed their tap delays for mobile pages, it's probably time to stop using TapEventPlugin and just us the onClick event. As for gestures, I'm considering building higher-order-components to detect them, and I certainly won't be quite about it if it happens. 😉 |
👍 |
But how long will it take for these changes to hit iOS Safari? The latest iOS 9.3.1 doesn't have fast tap response. |
Totally agree @appsforartists. However, while |
onTouchTap stops working in React 15. I've prepared this reduction.
The only difference between pane A and pane B is which version of React is used. If you open it on a touchscreen device (or in DevTools with emulation on), you'll see that onTouchTap worked in React 14, but ceases to work in React 15.
The text was updated successfully, but these errors were encountered: