-
Notifications
You must be signed in to change notification settings - Fork 41
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
fix: #29 sometimes clicks bleed through to other elements. #33
Conversation
Had a similar pull request to this opened before, the problem is that the Going to have a look into this today. :) |
@JakeSidSmith Any update on this? I'm having a lot of bleed when using a button to trigger a popup with an input. The input currently get's clicked directly because it is at the same coordinates as @qimingfang suggested. Thanks! |
I've had this issue reported a lot, but never been able to reproduce. Still waiting on anyone to give me a small example project with the issue present. |
@JakeSidSmith I'll provide one as soon as I can, could take some time as my schedule now is quite full. Wrote it down on my todo list! |
@JakeSidSmith I can not immediately give the project to you, but I have something I want you to try on one project you have. Will not it reproduce with the full screen web application which added from safari to the home screen? In my case, it worked normally on safari. In addition, the problem of the select tag which is talked about in this issue also occurred in full screen . |
I tried reproducing the problem. https://gomo.github.io/react-fastclick-test/index.html After all, adding it to the home screen and displaying it with full screen does not reproduce. Please open the page on safari with iPhone, add it to the home screen, start up and try it. The source is here. This is main component. |
@ Nealoke I made a project to reproduce the problem so I will report it. However, it will only be reproduced when it is added to the home screen and started with full screen. If you have any code to reproduce with normal safari please provide it. |
@gomo sorry I haven't responded yet. Will try to take a look some time this week. |
@JakeSidSmith @gomo Thanks! Note that this is also on android chrome, not on desktop |
Released an alpha version with these changes: #50 If @gomo @nealoke @qimingfang could test and see if it's fixed your issues, that'd be great. :) |
I stumbled upon this problem today, and tried my hands at a fix. Worked for me, so maybe will work for others as well.
I think the problem is because we need to prevent the handler of the original event while we issue the onClick event handler on the react-click event. Otherwise, we risk calling
onClick
, then eventually triggering theonClick
behavior of the javascript event again on the same x,y coordinates, resulting in clicks to bleed throughThere isn't a good way to inject this into the ReactUtil tests, since this is testing the js event system, not the React synthetic event system, so this PR only assures that none of the existing tests break.