ionic-framework: Bug: Swipe back doesn't work on iOS
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
- v4.x
- v5.x
- v6.x
- Nightly
Current Behavior
Created a basic Svelte app, going though Ionic. On Safari browser Swipe back works fine. On WebView via default iOS app it works. On Ionic it doesn’t work.
Expected Behavior
Swipe back on iOS should work by default, no matter what is rendering via the platform.
Steps to Reproduce
Make Ionic app. Host HTML app with a link. Observe that swipe back doesn’t work.
Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 5.4.16
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v16.15.1
npm : 8.11.0
OS : macOS Monterey
Additional Information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (6 by maintainers)
@Steven0351 Ah yes it was the simulator, thank you so much for your help!
@ollydixon I was able to clone your repo, make the necessary changes, and got backward and forward swiping to work (starts at about 6 seconds in):
https://user-images.githubusercontent.com/24440751/185662611-fd08d5ea-4f1b-4faa-bff0-b5104751cdea.mp4
Not sure if you’re testing on a device or simulator, but the simulator is finicky and your mouse cursor needs to be exactly on the edge that you’re swiping from or just beyond. The backward and forward swiping will not work if you start a swipe on the page itself.
@ollydixon you should be able to achieve what you want with an approach similar to this: https://github.com/ionic-team/capacitor/issues/1097#issuecomment-1077649377
I think there may be a misunderstanding here. This is the repo for Ionic Framework, which is an optional UI toolkit that you can use with Capacitor. Your application does not use Ionic Framework, so this is not the correct repo for this bug report.
I think you may want the Capacitor repo instead. However, I do know that Capacitor disables the swipe to go back gesture on WKWebView. The built-in swipe to go back gesture tends to interfere with any custom gesture logic that developers may have added to their applications which is why it is disabled. If you are looking for a way to re-enable it or you have more questions about Capacitor you will probably have more luck creating a new discussion on the Capacitor repo.