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.

lazy load of ionic3 tabs app messed up at android and browser Back Button

See original GitHub issue

Ionic version: (check one with “x”) [ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [x ] 3.x

I’m submitting a … (check one with “x”) [x ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: While switching pages 3 or more layers deeper, then click back button of android or browser, can not go back to the page previous visited.

Expected behavior: go back to the page previous visited.

Steps to reproduce: The bug repo is at back-button-bug

  1. start the project using ionic serve
  2. go to the contact tab, then click the go detail button, then click the go detail deeper button
  3. click the back button of android or browser, you will find that you can not go back to the page previous visited. More clearly, it should be the page where go detail button display.

Other information: the back button works fine if you only view 1 or 2 layer。

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

global packages:

    @ionic/cli-utils : 1.4.0
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.4
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Ionic Framework                 : ionic-angular 3.0.1

System:

    Node       : v6.9.2
    OS         : macOS Sierra
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.9

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hellogithub2014commented, Sep 14, 2017

@karansharma27 Yes, I found why that happened. If you have two pages , A is lazy loaded, B is not. When you navigate to B from A, after a while you want go back to A, you will find this issue. THE SOLUTION is make A and B both lazy loaded, that works for me.

1reaction
hellogithub2014commented, Jul 5, 2017

-----------update-------------

  1. After I updated my ionic-angular to 3.5.0(I copied the package.json from ionic-conference-app ), some of the above bugs were fixed. Thanks for your guys’ hard working!
  2. BUT there is one another bug I found: The back button of page’s behavior does not consistent with the back button of browser’s. The previous one often does not change the hash of url, but the latter one does. So if you use different button with different order, then bugs come out.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

lazy load of ionic3 tabs app messed up at android ... - GitHub
While switching pages 3 or more layers deeper, then click back button of android or browser, can not go back to the page...
Read more >
ionic 4 - android back button not working for tab-bar routes
I'm expecting to go back to previous navigated page/tab. It looks like the router is not considering routes inside tabs page. My app.routes...
Read more >
Ionic 3+ solving the hardware back button, avoiding to close ...
Considering that we are using lazy loading approach. Firstly let's import the App component and declare it in the constructor, as we will...
Read more >
ion-back-button-tabs - npm
Start using ion-back-button-tabs in your project by running `npm i ... an alternative workaround and a problem description look here.
Read more >
jomendez - There's a way to do it better - find it. -Thomas A ...
You can set the tab placement, icon mode, animations, define back button icon, ... To learn more about how to use lazy load...
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