JakeSidSmith / react-fastclick

Fast Touch Events for React
https://www.npmjs.com/package/react-fastclick
MIT License
487 stars 41 forks source link

unexpected page reload when using with react router #34

Open hcapp01 opened 8 years ago

hcapp01 commented 8 years ago

react router 2.3 ios 9.1 longpress on link like this will reload page

<Link style={{ paddingBottom: 8 }} className={className} key={key} to={'/' + classDef.path + '/' + key} >

joe-schorn commented 7 years ago

Commenting out this line seems to fix it: newProps.onTouchMove = onTouchMove.bind(null, props.onTouchMove);

JakeSidSmith commented 7 years ago

I've had a couple of similar issues reported, but never been able to reproduce. Would either of you be able to put together a small test project with the issue that I can debug on?

Thanks for taking a look into the code @joe-schorn. I'll be sure to see if onTouchMove is the culprit, and if there's some way I can fix without removing it that callback.

@hcapp01 @joe-schorn

joe-schorn commented 7 years ago

@JakeSidSmith sure no problem. I've should be able to get a test project for you tomorrow.

JakeSidSmith commented 7 years ago

Awesome, thanks for the help. Link me from here when you've got a lil project setup, @joe-schorn . :)

P.s. have you been able to reproduce on an emulator?

joe-schorn commented 7 years ago

@JakeSidSmith Sorry I got slammed at work. When I put a project together and pulled the latest 3.0.1, it seems to be resolved. I had an older version in the other project I was working on. I pulled the latest and it's working there too. When I did see the issue I was able to replicate it in the emulator. Thanks again for the lib and for your help!

JakeSidSmith commented 7 years ago

No problem. I'll double check with people that have opened similar issues before closing this one off. :)

JakeSidSmith commented 7 years ago

Please try the alpha version I've just released and let me know if it resolves your issues. :)

https://github.com/JakeSidSmith/react-fastclick/pull/50

fjaskolski commented 7 years ago

Hello there!

I've run into the exact same issue while using: react-router-dom 4.1.1 (react-router 4.1.1) react-fastclick 3.0.2

The page reloads on clicks performed randomly (long press, sometimes short double tap), both at iOS 10.0.2 and within Chrome devtools device view.

I'm wondering if you have any ideas on how can I debug this further?

Cheers

JakeSidSmith commented 6 years ago

Reopening to investigate further.

samcfinan commented 6 years ago

Same issue here. react-router-dom 4.2.2. Disabling react-fastclick resumes normal behavior.