Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Swipe in iOS? #67

Closed
adjourn opened this issue Sep 19, 2016 · 5 comments
Closed

Swipe in iOS? #67

adjourn opened this issue Sep 19, 2016 · 5 comments

Comments

@adjourn
Copy link

adjourn commented Sep 19, 2016

Swipe from left goes back in browser history and swipe from right goes forward.

Unfortunately I cannot test it myself on iOS..

Does this component works around this? How?

I would love to reuse this trick with other components if I need to use swipes from left or right.

@tonygentilcore
Copy link

I bumped into this too. Would be nice to fix. This thread discusses some potential workaround, but I can't quite tell whether it's possible or not:
http://stackoverflow.com/questions/8737709/any-way-to-prevent-horizontal-scrolling-triggering-swipe-back-gesture-on-os-x-li

@MilllerTime
Copy link
Contributor

MilllerTime commented Jan 5, 2017

This component does not currently work around this issue.

One simple approach would be to increase the size of the touch handle via the touchHandleWidth prop.

Another possible solution (haven't tested it myself) would be to fork the repo and prevent the default action from the touch events on the touch handle. @tonygentilcore's SO link mentions this technique as well. That could introduce other possible undesirable effects, like preventing page scrolling entirely, but might work for you. It would theoretically be possible to add a boolean prop on react-sidebar that would enable this behavior.

@Tomekmularczyk
Copy link

I think right now the best solution is to detect iOS and disable touch handle. To infer default iOS behavior may produce undesirable side effects (as mentioned) and bad user experience.

@MilllerTime
Copy link
Contributor

Worth noting that if users save your web app to the home screen, the touch handle works really well. If that's a common use case, then the interactivity may be worth preserving.

This was referenced Jul 30, 2018
@markusenglund
Copy link
Collaborator

Since there is now way of disabling the IOS swipe behaviour in JavaScript, I was forced to remove the touch features completely from IOS in react-sidebar version 3.

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

No branches or pull requests

5 participants