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.

NavControll stuck when pushing pages with insertPages and poping them out,

See original GitHub issue

Short description of the problem:

Im trying to push multiply pages using insetPages. Im pushing the pages to the top of the stack. Everything works great until im starting to pop out the pages… All the pages are poping out good but when the first page that was inserted is on the top of the stack the application stuck!

What behavior are you expecting?

the pop should not change his effects

Steps to reproduce:

  1. create a page with a button that will insertPages, try more then 5 pages to insert
  2. start clicking the back button on each inserted page.
  3. the app will stuck
  pushPages(i) {
    let pagesToPush = []
    for(let x=0;x<=i;x++) {
      pagesToPush.push({page: ContactPage, params:{pageNumber: x}})
    }

    this.navCtrl.insertPages(this.navCtrl.length(), pagesToPush);
  }

Which Ionic Version? 1.x or 2.x 2.x

Plunker that shows an example of your issue

I was not able to reproduce on plunker but was able by creating a new project. https://github.com/royipressburger/navControll-error-example This one is just clone of the starter tabs. just clone it and run serve --lab

click on one of the buttons… You will see that when pushing 1 or 2 pages all is good but when pushing 3, the app stucks.

Run ionic info from terminal/cmd prompt: (paste output below) Cordova CLI: 6.3.1 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.37 Ionic App Lib Version: 2.0.0-beta.20 OS: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Node Version: v5.10.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
rcjsuencommented, Sep 16, 2016

I thought about the issue some more and it seems to me like the most straightforward solution would be to just iterate over the navigation stack and record the highest Z-index out of all of the views. Once we have that, we can then increment that value by one and set that value as the Z-index of the entering view. That would most certainly ensure that the entering view is visible to the user as it would have the highest Z-index value out of all the views in the navigation stack.

I feel that this is the simplest solution that guarantees a valid Z-index but I’m not sure if performance is a concern here given that we are iterating over the entire navigation stack. Perhaps we should alternatively be storing this maximum Z-index value as a member variable within NavControllerBase?

0reactions
royipressburgercommented, Oct 19, 2016

Cannot reproduce this issue with rc.1 closing for now

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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