-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
bug: NavController.pop() doesn't work when leave Tabs layout. #18593
Comments
Same issue here |
Any news about this issue ? |
Any update on this? |
I've updated this issue with an up-to-date reproduction of the issue. An alternative pattern to avoid this issue is to use For example, in the @Component({
selector: 'app-item21',
templateUrl: 'item2.page.html',
})
export class Item2Page {
constructor(@Optional() private ionRouterOutlet: IonRouterOutlet) { }
async goBack() {
return this.ionRouterOutlet.pop();
}
} Results in the "Go to Page 1 Programmatically" button popping to the correct view. My assessment of the issue is that |
Ok the problem is here: https://github.com/ionic-team/ionic-framework/blob/main/angular/src/directives/navigation/ion-router-outlet.ts#L311-L315 When navigating from a page outside the tabs outlet back into the outlet,
However, the promise resolves out of the expected order, so even though setting the active outlet to the tab is invoked last, the promise resolves before setting the active outlet to the primary outlet. This results in the top outlet being set to the root Likely this implementation needs to be changed to a queue with rxjs, to guarantee the order of when setting the active entering view, coincides with the order of which should be activated. |
This comment was marked as outdated.
This comment was marked as outdated.
Updated dev-build available for testing: npm install @ionic/[email protected] |
Dev build works fine for us! 😊 |
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. |
Bug Report
Ionic version:
Current behavior:
When I call navCtrl.pop from a nested outlet which is not in a tab, it redirects back to the right tab which has some nav stack, but then navCtrl.pop doesn't work. With ion-back-button it works fine.
Expected behavior:
NavContoller.pop() should be able to navigate to the correct page in nav stack as ion-back-button does.
Steps to reproduce:
https://github.com/sean-perkins/gh-18593-nav-pop
ion-back-button
(< Item 2 Page)Expected:
The text was updated successfully, but these errors were encountered: