Skip to content
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

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

Closed
bhj opened this issue Feb 26, 2019 · 12 comments · Fixed by #131
Closed

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

bhj opened this issue Feb 26, 2019 · 12 comments · Fixed by #131
Assignees

Comments

@bhj
Copy link

bhj commented Feb 26, 2019

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
Copy link
Collaborator

hartzis commented Feb 27, 2019

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

  • could add onSwiping={() => {}} prop to your <Swipeable> usage along with preventDefaultTouchmoveEvent and it should work.

  • could also try calling e.preventDefault() on the event within your code to.

...

(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
Copy link

JiiB commented Mar 12, 2019

I currently have the same issue 😞

@JiiB
Copy link

JiiB commented Mar 12, 2019

@bhj did you find a workaround?

@JiiB
Copy link

JiiB commented Mar 13, 2019

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

@hartzis
Copy link
Collaborator

hartzis commented Mar 13, 2019

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

@hartzis
Copy link
Collaborator

hartzis commented Mar 13, 2019

What we've discovered so far:

Bug report(s) from around the web:

@hartzis
Copy link
Collaborator

hartzis commented Mar 17, 2019

Essentially the root issue - facebook/react#2043

@hartzis
Copy link
Collaborator

hartzis commented Mar 18, 2019

@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
Copy link

JiiB commented Mar 18, 2019

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

@bhj
Copy link
Author

bhj commented Mar 19, 2019

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

@hartzis
Copy link
Collaborator

hartzis commented Mar 20, 2019

Thank you @JiiB and @bhj !

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

@hartzis
Copy link
Collaborator

hartzis commented Mar 21, 2019

Still on target to release 5.1.0 this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants