-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: react swipe to go back does not implement gesture properly #22342
Comments
Thanks for the issue. Looks like this is the culprit:
onMove callback.
|
@liamdebeasi Is there already a pull request? |
There is no PR yet. Are you interested in working on this? |
@liamdebeasi I could try, I do not work with ts often ^^ |
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
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 |
This issue has been labeled as 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! |
Thank you @liamdebeasi. I will start contributing as soon as possible :) |
@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. |
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 edit: use |
Hello @BerkeAras I kindly wanted to ask about your progress. Are you already working on a PR or is this topic still open? Thanks already and best regards. |
Hey @patrickap-bkklinde :) Unfortunately I have to work very much in the last few months, I could not work on a PR :( I will work on it as soon as possible 👍 |
FYI I noticed that the ion-nav component already has the native transition: https://ionicframework.com/docs/api/nav, so developing the transition is not needed, it just needs to be ported to the router component |
Hi @BerkeAras have you had the chance to look into this yet? |
I have still difficulties using Gestures to swipe back and to cancel going back @milanharia. |
@BerkeAras What have you done so far? Have you tried to edit the onStart and onEnd handlers as mentioned above? |
will this be fixed for ionic 6? |
Thanks @liamdebeasi. I tried the command you gave but get |
Ah right, I forgot that NPM is having some issues: https://status.npmjs.org/incidents/6wr25yb0b2dd. I'll publish another dev build once the issue is resolved. |
Try |
@liamdebeasi swipe back gesture seems to be working with the build you shared. However, I noticed that page animations (when navigating forward, as an example, on iOS) don't seem to work with this build. |
@liamdebeasi I have also noticed what @rgoldiez mentioned. I have also managed to break the navigation stack multiple times when navigating back and forth between pages (the URL will update but the page will not change), and some pages will just flash when trying to swipe back. |
|
Thanks for testing! Here's a dev build with the page animation fix. I also update the comment in #22342 (comment).
|
@liamdebeasi - this build fixes the animation issue. One question on swipe back functionality - should it take you to back to the same page that the back button would? The scenario I have is that a nest page could be reloaded onto that nested page (ie, no pages in the stack). The back button has a default route such that pressing the back button takes the user back to where they would expect to go. However, in this scenario (without any pages in the stack) the swipe gesture opens the side menu. Is this expected? |
I am assuming you are talking about In your scenario, yes that is to be expected. The reason for this is the component for the default route has not been created and therefore does not exist in the DOM/any navigation stack. The swipe to go back behavior is designed to work when there is an existing page to go back to in the navigation stack. |
@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 |
To clarify my comment, |
@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 Screen.Recording.2022-07-01.at.20.28.29.movFind the repo here to reproduce. |
Thanks! This dev build should fix that issue:
|
@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 Double animation Screen.Recording.2022-07-04.at.09.41.39.movFlashing IonPage Screen.Recording.2022-07-04.at.09.46.55.mov |
Thanks, I was able to fix both of those in my PR. Here is another dev build if you are interested in testing:
|
@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 RPReplay_Final1657209759.MP4 |
Do you have a sample app I can test this in? I am unable to reproduce this locally. |
Please find the repo here. |
Thanks! This dev build should fix the issue:
|
resolves #22342 Co-authored-by: masonicboom <[email protected]>
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! |
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. |
Bug Report
Ionic version:
[ ] 4.x
[x] 5.x
Current behavior:
iOS Swipe back not working properly on React
Expected behavior:
App should go back after swiping, not while swiping.
Steps to reproduce:
Sample App: https://azbs-app-dev.azurewebsites.net/schedule
The text was updated successfully, but these errors were encountered: