Skip to content

bug: react swipe to go back does not implement gesture properly #22342

Closed

Description

@BerkeAras

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

Activity

  1. 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
  2. added
    package: react
    type: bug
    on Oct 19, 2020
  3. liamdebeasi commented on Oct 19, 2020

    @liamdebeasi
    Contributor

    Thanks for the issue. Looks like this is the culprit:

    . When the gesture starts, Ionic React just navigates back instead of using the onMove callback.

  4. BerkeAras commented on Oct 19, 2020

    @BerkeAras
    Author

    @liamdebeasi Is there already a pull request?

  5. liamdebeasi commented on Oct 19, 2020

    @liamdebeasi
    Contributor

    There is no PR yet. Are you interested in working on this?

  6. BerkeAras commented on Oct 19, 2020

    @BerkeAras
    Author

    @liamdebeasi I could try, I do not work with ts often ^^

  7. liamdebeasi commented on Oct 23, 2020

    @liamdebeasi
    Contributor
  8. added
    help wanted
    on Oct 23, 2020
  9. ionitron-bot commented on Oct 23, 2020

    @ionitron-bot

    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!

  10. BerkeAras commented on Oct 25, 2020

    @BerkeAras
    Author

    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 onStart and onEnd handlers for routerOutlet:

    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

    Thank you @liamdebeasi.

    I will start contributing as soon as possible :)

  11. BerkeAras commented on Nov 6, 2020

    @BerkeAras
    Author

    @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.

  12. liamdebeasi commented on Nov 6, 2020

    @liamdebeasi
    Contributor

    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 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

  13. 33 remaining items

  14. rgoldiez commented on Jul 1, 2022

    @rgoldiez

    @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.

  15. milanharia commented on Jul 1, 2022

    @milanharia

    @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.

  16. liamdebeasi commented on Jul 2, 2022

    @liamdebeasi
    Contributor

    Thanks! This dev build should fix that issue:

    6.1.13-dev.11656722810.12f349fc
    
  17. milanharia commented on Jul 4, 2022

    @milanharia

    @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.

    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

  18. liamdebeasi commented on Jul 5, 2022

    @liamdebeasi
    Contributor

    Thanks, I was able to fix both of those in my PR. Here is another dev build if you are interested in testing:

    6.1.13-dev.11657055102.1ed275da
    
  19. rgoldiez commented on Jul 5, 2022

    @rgoldiez

    @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!

  20. milanharia commented on Jul 7, 2022

    @milanharia

    @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).

    https://user-images.githubusercontent.com/76167627/177820522-e9420b23-2553-4877-821f-1f2233d16c9a.MP4

  21. liamdebeasi commented on Jul 7, 2022

    @liamdebeasi
    Contributor

    Do you have a sample app I can test this in? I am unable to reproduce this locally.

  22. milanharia commented on Jul 7, 2022

    @milanharia

    Please find the repo here.

  23. liamdebeasi commented on Jul 7, 2022

    @liamdebeasi
    Contributor

    Thanks! This dev build should fix the issue:

    6.1.13-dev.11657232231.14fdde4d
    
  24. added a commit that references this issue on Jul 19, 2022
    7ec3683
  25. liamdebeasi commented on Jul 19, 2022

    @liamdebeasi
    Contributor

    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!

  26. ionitron-bot commented on Aug 18, 2022

    @ionitron-bot

    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.

  27. locked and limited conversation to collaborators on Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedpackage: reacttype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions