Skip to content

Apps close by backpress in not "home" page #2293

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
juniorschen opened this issue Nov 10, 2020 · 2 comments
Closed

Apps close by backpress in not "home" page #2293

juniorschen opened this issue Nov 10, 2020 · 2 comments

Comments

@juniorschen
Copy link

image

So I have a structure with just a lazy module that contains several children, one of these childrens is my "home" page, but no matter what child I am in, the app always closes ...

https://github.com/juniorschen/IGivenUp

what i hope:
image

Let the apps only close when I am on the "/ test" route, if it is in "/ test2" it should not close, I would not like to hear suggestions for signing up for backpress events :D

@nikoTM
Copy link

nikoTM commented Nov 25, 2020

The framework has no way of knowing what you consider "home" screen, the back button will put the app in the background if navigation stack is empty (you are on the first Frame). In your case the only Frame that's created is FeatureComponent, since the other components are used in a router-outlet, if you want them to be part of native mobile navigation use page-router-outlet.

https://docs.nativescript.org/angular/core-concepts/angular-navigation#page-router-outlet

Duplicate #477

@juniorschen
Copy link
Author

@nikoTM It is horrible to have to handle backpressed events, as this causes a headache with the modals, so I have a large volume of code that I would not need to have inside the app, but if this is really the only solution thank you

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