-
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
onClick on mobile not fired #2055
Comments
Can you try adding |
Now, the strange thing is ... |
@taddei Yeah, that's "expected", React attaches event listeners to the document. iOS doesn't fire click events for nodes (at all) unless they seem "clickable" (i.e., has a click event listener or |
See #1169. |
see here for more details: facebook/react#2055
see here for more details: facebook/react#2055
Adding the |
This should have been fixed in 0.14 already. |
It isn't. I'm on 0.14.7 |
Any updates on this? |
This is closed which indicates no one is looking at it. But http://react.jsbin.com/mimovoluci uses React 15 and works on my iPhone. Can someone post an example that is broken? |
@spicyj by "works on my iPhone" you mean the click is instantly recognized? There is no touch delay? |
Oh, I totally misunderstood you. It is expected that you get the same click delay as any other onclick handler. The bug that this was tracking is that clicks didn't work at all on iOS. You have to use something like react-tappable that listens to touch events or a script like fastclick. |
@spicyj yeah, I am using |
@spicyj I've tried the example from jsbin, but doesn't work in Safari 9.0. |
I am using React 15, and this works everywhere but iphone 4, ios 8. I tried buttons, a tag but cant that click to run a function. |
This appears to be broken again in v16 React. I have tried the cursor pointer fix and it still does not fire correctly. I have to resort to using both onClick and onTouchStart. |
Please file a new issue if you see a new problem. Issues from 2014 aren't actively monitored and the reasons are likely different. |
but why Dan? This issue shows the history of the problem. Creating a new one just fragments issue for no reason (except that this one here is old). |
It is annoying really ! It is simply stop accepting click for whatever reason ! Is that because Apple want everyone on app ? Steve |
Hey all, I'm going to lock this because I'm worried comments for this will be missed, or that people may pattern match this issue with a new issues which is very likely to have a different cause. If you're seeing issues related to onClick not firing, please submit a new issue with a full reproduction in a codesandbox. |
I have put together a test case that replicates the issue:
https://github.com/taddei/react-bug-test
On desktop browsers the click handler is triggered correctly, the same code on iOS mobile devices (tested both on simulator and actual devices) does not fire the event. Works fine on android.
The text was updated successfully, but these errors were encountered: