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

Reset navigation path #30

Closed
rifqifadh opened this issue Jan 26, 2023 · 2 comments
Closed

Reset navigation path #30

rifqifadh opened this issue Jan 26, 2023 · 2 comments

Comments

@rifqifadh
Copy link

rifqifadh commented Jan 26, 2023

Hello!
I get this instant pop-back on the last view when trying to reset the navigation path.

Sample Code
Simulator Screen Recording - iPhone 14 Pro - 2023-01-26 at 21 14 50

@johnpatrickmorgan
Copy link
Owner

Thanks for raising this issue @rifqifadh!

I think this change fixes this issue, but I'd like to take some time to check that it doesn't cause any other issues before merging.

Note though, that when replacing the stack of screens with a new stack, the animation seen will be dictated by the difference in screen count between the new and old stacks:

  • If the new stack is smaller, there will be a pop animation.
  • If the new stack is one larger, there will be a push animation.
  • If the new stack is the same length (as in your case), there will be no animation.
  • If the new stack is more than one larger, you should wrap the mutation in a withDelaysIfUnsupported call to ensure SwiftUI reflects the new screen stack in the UI. This overcomes a limitation of NavigationView.

@johnpatrickmorgan
Copy link
Owner

I've now merged this fix in v0.7.1, as I don't see any regressions. Thanks for raising this issue @rifqifadh.

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

No branches or pull requests

2 participants