Skip to content
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

Can not swipe back on iOS when using nested navigation #1932

Closed
jtdLab opened this issue Apr 18, 2024 · 11 comments · May be fixed by #1941
Closed

Can not swipe back on iOS when using nested navigation #1932

jtdLab opened this issue Apr 18, 2024 · 11 comments · May be fixed by #1941

Comments

@jtdLab
Copy link
Contributor

jtdLab commented Apr 18, 2024

Is it possible to configure auto_route to allow dismissing parent via iOS back swipe if there is only 1 page on the nested navigation stack.

  AutoRoute(
    path: '/',
    page: PageARoute.page,
  ),
  AutoRoute(
    path: '/a',
    page: ShellARoute.page,
    children: [
      AutoRoute(
        path: '',
        page: PageAARoute.page,
      ),
      AutoRoute(
        path: 'b',
        page: PageABRoute.page,
      ),
    ],
  ),

e.g when stack is PageA, ShellA --- PageAA meaning PageAA is currently shown. Is it possible to make auto_route detect that ShellAs stack only contains 1 route and allow pop PageAA and the ShellA (similar to context.maybePop()) via back swipe?

Currently to achieve that the sub pages can be popped via swipe the router setup has to be changed to:

  AutoRoute(
    path: '/',
    page: PageARoute.page,
  ),
 AutoRoute(
        path: '/a',
        page: PageAARoute.page,
      ),
AutoRoute(
   path: '/a/b',
   page: PageABRoute.page,
),
@Milad-Akarie
Copy link
Owner

@jtdLab this issue was fixed in 8.0.1, are you sure you're on the latest version?

Milad-Akarie added a commit that referenced this issue Apr 22, 2024
Docs: add documentation for DeepLinkTransformer
@Milad-Akarie
Copy link
Owner

@jtdLab there was a related issue to back-gestures, please check if you still have the problem in 8.1.1

@jtdLab
Copy link
Contributor Author

jtdLab commented Apr 22, 2024

@Milad-Akarie Hey, thanks for the quick response :) Sadly i am still running into the problem. Can you check the sample at https://github.com/jtdLab/ios_nested_swipe to make sure we are on the same page.

@Milad-Akarie
Copy link
Owner

@jtdLab Thanks for providing the sample repo, it was fixed by this PR #1940 in version 8.1.2
please confirm and close

@jtdLab
Copy link
Contributor Author

jtdLab commented Apr 23, 2024

@Milad-Akarie Checked it and it now allows to pop the shell via swipe. However the swipe dismisses the shell route no matter how many child routes are on its stack (see updated sample) i think it would be good to align behavior with context.maybePop() and pop child pages (if there are more than 1) and else the shell. Or at least allow to configure that popping behavior.

@iagoandrei
Copy link
Contributor

@jtdLab Hello. Check if this PR corrects the situation described. #1941

@Milad-Akarie
Copy link
Owner

@jtdLab Check latest release

@jtdLab
Copy link
Contributor Author

jtdLab commented Apr 26, 2024

@Milad-Akarie is it on pub.dev?

@Milad-Akarie
Copy link
Owner

I left in a hurry, I must've forgotten to confirm the upload

@jtdLab
Copy link
Contributor Author

jtdLab commented Apr 27, 2024

Works 👍

@nausharipov
Copy link

The issue is present in the current version 9.2.2: #2092

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

Successfully merging a pull request may close this issue.

4 participants