question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: How to navigate forward to same page with animation

See original GitHub issue

I’m migrating ionic 3 app to ionic 4. In old app we have complex component what we use with navCtr.push multiple times, with different data. Because those components have related details, we can really go deep on the nav stack. So we have the same compontent into the nav stack multiple times. In the new ionic 4 I have one tabs child route for this. But when I’m navigating into the same page with different url params the animation not working. Is it possible to animate even if we navigating forward to the same page? Another possibe bug, when I’m on the serach tab, and trying to animate forward to the /tabs/home/component ,this is also the same component what I mentioned before, the animation is not working. It’s just displaying the correct tabs/home/childcompoennet but no animation. If I create child component to the search tab with the same component than the animation is working. Is this the correct way to create multipliple router endpoints under several tabs just to be abble to navigate forward with animation? I really need to find soultion for this, otherwise we cannot migrate our application.

Thanks for the help.

`Ionic:

ionic (Ionic CLI) : 4.10.1 Ionic Framework : @ionic/angular 4.4.0 @angular-devkit/build-angular : 0.13.9 @angular-devkit/schematics : 7.3.9 @angular/cli : 7.3.9 @ionic/angular-toolkit : 1.5.1

System:

NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe) npm : 6.4.1 OS : Windows 10 `

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
BDominikcommented, Jun 27, 2019

I didn’t. To display animation yes we can create 2 different routes, and than load the same page once into the route 1 and next time to route 2. But thats ugly solution in our case because we can go to that route from multiple tabs. So i need to create that 2 extra route for each tabs, to show the navigation animation properly. And we push multiple times that component in ionic 3 its works fine with nav push, but I dont know how to do it with ionic 4. Also we subscrabing to the ngrx store each time on that component. And cannot subscribe on onNgDestroy and on ionViewWillLeave. So if I visiting third time that page than the 3 subscription happens, which not good. Currently I’m migration the rest of the app, and I going to try this later again.

1reaction
dansiemenscommented, Jun 24, 2019

By default, the router ignores navigation requests to the current URL. In your app-routing module, set onSameUrlNavigation: 'reload', which should look like:

RouterModule.forRoot(routes, {
    onSameUrlNavigation: 'reload',
   ...
}),

Alternatively you could abstract the content of your page into a component, and put the component into two different pages that have routes to each other, as I don’t believe the above solution will animate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: How to navigate forward to same page with animation ...
I'm migrating ionic 3 app to ionic 4. In old app we have complex component what we use with navCtr.push multiple times, with...
Read more >
angularjs - Animating view navigation forwards and backwards
I can't see anything wrong with your example: the animation seems to work fine, both on click, and on forward/backward using the browser....
Read more >
Animate a page route transition - Flutter documentation
Animate a page route transition · 1. Set up a PageRouteBuilder · 2. Create a Tween · 3. Use an AnimatedWidget · 4....
Read more >
animation-direction - CSS: Cascading Style Sheets | MDN
The animation-direction CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing ...
Read more >
Build Amazing Page Transitions In Only 12 Minutes - YouTube
Having animated page transitions on a website makes it appear incredibly polished and adds an extra touch that most websites do not have....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found