Repository navigation
Open
Labels
Description
Bug Report
Ionic version:
[x] 4.3.1
Current behaviour:
Using child-routes stops working using nested ion-router-outlets.
Issues that could be related: #17638, #17825.
1st
If links and ion-router-outlet are placed inside ion-content links are not clickable.
<!-- No interaction possible -->
<ion-content>
<a routerLink="app-one">App One</a>
<a routerLink="app-two">App Two</a>
<ion-router-outlet></ion-router-outlet>
</ion-content>If links are placed outside ion-content they are clickable.
<!-- Interaction possible -->
<a routerLink="app-one">App One</a>
<a routerLink="app-two">App Two</a>
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>2nd
Only the first navigation to a child route works.
After this, the view is not updated anymore.
Expected behaviour:
- A click on a link should navigate to the corresponding component configured in the routing module.
Steps to reproduce:
git clone https://github.com/GregOnNet/ionic-4-jest-setup.gitcd ionic-4-jest-setup.gitgit checkout routingnpm installionic serve- Visit http://localhost:8100/tabs/tab2
- Click on App One
- Click on App Two
- Note that navigation stops working
Related code:
- https://github.com/GregOnNet/ionic-4-jest-setup/tree/routing
⚠️ You need to checkout branch routing
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.12.0 (/Users/gregor/.config/yarn/global/node_modules/ionic)
Ionic Framework : @ionic/angular 4.3.1
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.3.8
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.5.1
System:
NodeJS : v10.15.3 (/Users/gregor/.nvm/versions/node/v10.15.3/bin/node)
npm : 6.4.1
OS : macOS Mojave
Reacted by Christian, Markus Ende, Peter Müller, Frank Strieter, David Lejeune, Valentin Hăloiu, Ryan Q, MarcSchmer, TommiCodes, Nelson Martell and 1 more
Metadata
Metadata
Assignees
Labels
Type
Fields
Stage
None yet

Activity
[-]bug: Navigation stops working for child routes[/-][+]bug: Navigation stops working for nested ion-router-outlet[/+]Syleron commentedon May 12, 2019
any progress with this?
This is a blocking bug to my project
REPTILEHAUS commentedon May 18, 2019
Hitting similar issue +1
almothafar commentedon Jun 19, 2019
Got some annoying issue, nested
ion-router-outletis not working with correct behavior of back button as it only reads the first navigation on the main, not the sub, not sure if this related to this.MarcSchmer commentedon Jul 8, 2019
+1
It is a blocking issue for our project as well.
TommiCodes commentedon Jul 10, 2019
+1
Issue also occurs in our project
celliott181 commentedon Jul 12, 2019
+1
After dealing with multiple issues using ion-router-outlet across multiple releases we have decided to strip all use of the ionic router outlet in favor of the default angular outlet.
This came with some minor styling adjustment for the ion-app and loaded page components, but compared to the issues we faced using the outlet (ActivatedRoutes not having observable properties, lifecycle hooks not properly firing, nested views not navigating) it was a no brainer. The loss of cached pages is regrettable, but it also negated one of our most frequent sources of bugs.
nelson6e65 commentedon Jul 16, 2019
I have similar issue.
ActivatedRouteis not giving me theparentvalue (it's alwaysnull) when useion-router-outletin a child view.Only using
router-outletI'm able to getthis.route.parent (ActivatedRoute), but animations, etc, are lost. 😢nelson6e65 commentedon Jul 16, 2019
Is there a Ionic alternative for
ActivatedRoute?youuri commentedon Oct 25, 2019
This is a major issue. I've stuck more than a week to finally spot the origin of my bugs. So If you have an ionic v4 app with:
ion-router-outletin your codeYou will probably get some bugs when changing parent routes / menu / side-pane.
How could i know that the problem is related to
ion-router-outlet?I've check with a chrome://inspect to DOM of my app, i could see that during a parent swap navigation the old DOM for the page is stored and hide with
z-index: n-1where n is 101 for the current view.So i could have dom like this, with first navigation to main page B.
If i navigated back to main page A the bug will occurred a do:
And now the hell begins, cause with side-pane/menu, you will have bugged related to the fact that multiple dom instance are present for them.
workaround: Actually, i only have 2
<ion-router-outlet>so i decide to switch one of them to the original Angular one:<router-outlet>That's not the best ... but i hope ionic team will fix this shit.