FormidableLabs / react-swipeable

React swipe event handler hook
https://commerce.nearform.com/open-source/react-swipeable
MIT License
2k stars 147 forks source link

(5.x) preventDefaultTouchmoveEvent (Mobile Safari?) #127

Closed bhj closed 5 years ago

bhj commented 5 years ago

Hi and thanks for all your work.

I can't seem to prevent vertical scrolling during a left/right swipe using preventDefaultTouchmoveEvent with 5.x where 4.x works fine (iOS 12.1.4, React 16.8.3). I'm using it with onSwipedLeft and onSwipedRight and everything else default. Seeing same behavior in the example actually; any ideas or anyone else experiencing this?

hartzis commented 5 years ago

Thank you for posting this issue. I'll try to allocate some time next week to dig into this, but off the top of my head it could be related to the checks here:

NOTE: THIS IS AN IOS/SAFARI ISSUE

More info below in other comments and PRs.

~Fixes~

...

(btw the link to migrations.md in the readme and the "example migration" link in migrations.md are currently borked)

Thank you for pointing this out!

JiiB commented 5 years ago

I currently have the same issue 😞

JiiB commented 5 years ago

@bhj did you find a workaround?

JiiB commented 5 years ago

@bhj @hartzis I'm going to create a PR to fix this issue

hartzis commented 5 years ago

@JiiB what are your thoughts on an approach or we can just discuss when the PR is open.

hartzis commented 5 years ago

What we've discovered so far:

Bug report(s) from around the web:

hartzis commented 5 years ago

Essentially the root issue - https://github.com/facebook/react/issues/2043

hartzis commented 5 years ago

@JiiB I think i got a better solution after a lot more digging in today.

Please let me know what you think of #131

Also published it as react-swipeable@5.1.0-alpha.1

JiiB commented 5 years ago

@hartzis @bhj react-swipeable@5.1.0-alpha.1 works for me. you can now call event.preventDefault() inside of your onSwiping handler 👍

bhj commented 5 years ago

@hartzis Alpha is working over here too. Thanks for digging into this!

hartzis commented 5 years ago

Thank you @JiiB and @bhj !

I genuinely appreciate you both for testing and verifying the alpha version.

hartzis commented 5 years ago

Still on target to release 5.1.0 this week.