Skip to content

navigate back multiple times with one step #1167

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

Closed
cindy-m opened this issue Jan 24, 2018 · 6 comments
Closed

navigate back multiple times with one step #1167

cindy-m opened this issue Jan 24, 2018 · 6 comments

Comments

@cindy-m
Copy link

cindy-m commented Jan 24, 2018

In the app where I am currently work on, we have a situation where the user can navigate 4 pages down, with everywhere the possibility to go back one step. At the end of page 4, the user needs to be navigated back to page 2, with the back button in page 2 still working. So, actually go back 2 steps with just one animation.
I could not find how to this with the routerExtension in any way. Use Frame.goBack(to:BackStackEntry) works to navigate back to the second page, but when the user than taps back to the first page, the navigation brakes and it is not possible to move to the second page anymore (all other navigations to other path that was not used before does work correctly).

Is there a way to go back more than one page in just one step without clearing the whole history so that the back button still works on that page?

I found this issue already in stacklayout where they have the same problem: NativeScript/NativeScript#3848

But I could not implement the suggested solution myself, (at least not without changing the code of NativeScript-angular itself and that is something we absolutely don't want)

@tsonevn
Copy link
Contributor

tsonevn commented Jan 25, 2018

Hi @cindy-m,
At this time similar functionality does not exist for NativeScript Angular. As you can see in issue #3848 this is a new feature, which is still under review. Regarding that, the discussed option for using BackstackEntry is not recommended because it will break the navigation.

Something that I would suggest is to make the navigation with clear history option or to navigate back to the goBack() method as time as it needed.

@cindy-m
Copy link
Author

cindy-m commented Jan 25, 2018

@tsonevn is it possible to see somewhere what the status is of this new feature? So that we can implement and use it as soon as it will be released

@tsonevn
Copy link
Contributor

tsonevn commented Jan 26, 2018

Hi @cindy-m,
You could keep track of issue #3848.
We will update its status when we start working on it.

Hope this is applicable for you

@tsonevn tsonevn closed this as completed Jan 26, 2018
@ghost ghost removed the question label Jan 26, 2018
@franculeto
Copy link

Any update for this issue?

@tsonevn
Copy link
Contributor

tsonevn commented Dec 28, 2018

Hi @franculeto,
The initial feature request logged in issue #1367 is still under review. You can keep track of it for further info.

@androidovshchik
Copy link

Another way is to use clearHistory property

    let frame = frameManager.topmost();
    const navigationEntry = {
        moduleName: '/views/main-page/main-page',
        clearHistory: true
    };
    frame.navigate(navigationEntry);

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

4 participants