You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: react swipe to go back does not implement gesture properly #22342
changed the title [-]bug: iOS Swipe Back not working properly on React[/-][+]bug: react swipe to go back does not implement gesture properly[/+]on Oct 19, 2020
This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.
If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
For a guide on how to create a pull request and test this project locally to see your changes, see our contributing documentation.
@liamdebeasi I could not find anything about this in the contributing guideline: How can I preview my changes for react? Running npm start just runs a preview for ionic core.
To copy over your changes, you should first run npm run build in the packages/react and packages/react-router directory. Then, in the packages/react/test-app directory, run npm run sync to copy over the built changes. After that, you can use npm run start to start a live reload server for the test app.
edit: use packages/react-router/test-app instead of packages/react/test-app
@liamdebeasi - yes, your assumption is correct. And thanks for clarifying the behavior. I wasn't sure if it was suppose to get created (like pressing the ion-back-button) when the touch for the gesture starts.
To clarify my comment, ion-back-button seems to have to create the (default back route) page when it does exist in the stack.
@liamdebeasi I have noticed when you go from a parent page (/tab1) to a nested page (/nested1) and then to another nested page (/nested2), then swipe back twice to go back to the parent page, then go back to the first nested page, you are unable to swipe back to the parent. This is then resolved when you tap the ion-back-button. The journey would be /tab1 > /nested1 > /nested2 > /nested1 > /tab1 > /nested1 > /tab1. Here is a video to make it clearer:
@liamdebeasi I have also noticed that if you swipe back quickly across the entire screen, it causes the animation to trigger twice. I have also noticed in some instances the entire IonPage flashing when you swipe back to the page.
@liamdebeasi - this version works great! I had experienced one of the two issues that @milanharia had reported but no issues any more. Thanks for everyone's work on this!
@liamdebeasi I am experiencing really strange issues if you attempt to swipe back from the root level tab page. In the video below I swiped back from /tab1 and then it seemed to affect the navigational stack as you can see the flashes of the tab1 page when I routed to /tab2 and /tab3. I was then unable to access the nested pages in /tab1 (ie. /tab1/nested1).
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
[-]bug: iOS Swipe Back not working properly on React[/-][+]bug: react swipe to go back does not implement gesture properly[/+]liamdebeasi commentedon Oct 19, 2020
Thanks for the issue. Looks like this is the culprit:
ionic-framework/packages/react-router/src/ReactRouter/StackManager.tsx
Line 135 in 74af3cb
onMovecallback.BerkeAras commentedon Oct 19, 2020
@liamdebeasi Is there already a pull request?
liamdebeasi commentedon Oct 19, 2020
There is no PR yet. Are you interested in working on this?
BerkeAras commentedon Oct 19, 2020
@liamdebeasi I could try, I do not work with ts often ^^
liamdebeasi commentedon Oct 23, 2020
Thanks! We have a guide on contributing here: https://github.com/ionic-team/ionic-framework/blob/master/.github/CONTRIBUTING.md#creating-a-pull-request.
This fix needs to be implemented in the
onStartandonEndhandlers forrouterOutlet:ionic-framework/packages/react-router/src/ReactRouter/StackManager.tsx
Line 137 in 74af3cb
The easiest thing may be to adapt the solution we have for Ionic Vue: https://github.com/ionic-team/ionic-framework/blob/master/packages/vue/src/components/IonRouterOutlet.ts#L143
ionitron-bot commentedon Oct 23, 2020
This issue has been labeled as
help wanted. This label is added to issues that we believe would be good for contributors.If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
For a guide on how to create a pull request and test this project locally to see your changes, see our contributing documentation.
Thank you!
BerkeAras commentedon Oct 25, 2020
Thank you @liamdebeasi.
I will start contributing as soon as possible :)
BerkeAras commentedon Nov 6, 2020
@liamdebeasi I could not find anything about this in the contributing guideline: How can I preview my changes for react? Running npm start just runs a preview for ionic core.
liamdebeasi commentedon Nov 6, 2020
Good question. We have a test Ionic React application that you can use to preview your changes or write Cypress tests against: https://github.com/ionic-team/ionic-framework/tree/master/packages/react/test/test-app.
To copy over your changes, you should first run
npm run buildin thepackages/reactandpackages/react-routerdirectory. Then, in thepackages/react/test-appdirectory, runnpm run syncto copy over the built changes. After that, you can usenpm run startto start a live reload server for the test app.edit: use
packages/react-router/test-appinstead ofpackages/react/test-app33 remaining items
rgoldiez commentedon Jul 1, 2022
To clarify my comment,
ion-back-buttonseems to have to create the (default back route) page when it does exist in the stack.milanharia commentedon Jul 1, 2022
@liamdebeasi I have noticed when you go from a parent page (/tab1) to a nested page (/nested1) and then to another nested page (/nested2), then swipe back twice to go back to the parent page, then go back to the first nested page, you are unable to swipe back to the parent. This is then resolved when you tap the
ion-back-button. The journey would be/tab1 > /nested1 > /nested2 > /nested1 > /tab1 > /nested1 > /tab1. Here is a video to make it clearer:https://user-images.githubusercontent.com/76167627/176958192-0068584a-9ed4-4926-88f8-789691a36088.mov
Find the repo here to reproduce.
liamdebeasi commentedon Jul 2, 2022
Thanks! This dev build should fix that issue:
milanharia commentedon Jul 4, 2022
@liamdebeasi I have also noticed that if you swipe back quickly across the entire screen, it causes the animation to trigger twice. I have also noticed in some instances the entire
IonPageflashing when you swipe back to the page.Double animation
https://user-images.githubusercontent.com/76167627/177118083-5ef510f3-54c5-4d88-8807-66fc10cb44c1.mov
Flashing IonPage
https://user-images.githubusercontent.com/76167627/177118447-1c56c357-f4c1-43d0-b9a2-296a31854f91.mov
liamdebeasi commentedon Jul 5, 2022
Thanks, I was able to fix both of those in my PR. Here is another dev build if you are interested in testing:
rgoldiez commentedon Jul 5, 2022
@liamdebeasi - this version works great! I had experienced one of the two issues that @milanharia had reported but no issues any more. Thanks for everyone's work on this!
milanharia commentedon Jul 7, 2022
@liamdebeasi I am experiencing really strange issues if you attempt to swipe back from the root level tab page. In the video below I swiped back from
/tab1and then it seemed to affect the navigational stack as you can see the flashes of the tab1 page when I routed to/tab2and/tab3. I was then unable to access the nested pages in/tab1(ie./tab1/nested1).https://user-images.githubusercontent.com/76167627/177820522-e9420b23-2553-4877-821f-1f2233d16c9a.MP4
liamdebeasi commentedon Jul 7, 2022
Do you have a sample app I can test this in? I am unable to reproduce this locally.
milanharia commentedon Jul 7, 2022
Please find the repo here.
liamdebeasi commentedon Jul 7, 2022
Thanks! This dev build should fix the issue:
fix(react): swipe to go back gesture works on ios (#25563)
liamdebeasi commentedon Jul 19, 2022
Thanks for the issue. This has been resolved via #25563, and a fix will be available in an upcoming release of Ionic Framework.
Thank you to everyone who helped test!
ionitron-bot commentedon Aug 18, 2022
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.