This.nav.pop() stops responding and displays a black screen


#1

I have a simple app with a HomePage that calls a child PickPage that has a list of 3 pick items. When you tap on a selection it fires a function called pickPreference(item) and all it does is return to the parent page with this.nav.pop(). If you go back and forth several times between the parent and the child, it stops working and displays the image below but the most intriguing part is that there are no errors in the console.

Here’s the sample code. If you want to download a fully working demo of this issue, please go to this repo

home.html

<button ion-item (click)="pickDefaultDate()">
  <ion-label floating primary>Default Date</ion-label>
  <ion-input type="text" [(ngModel)]="settings.defaultdatedisplay" readonly></ion-input>
</button>

home.ts

import {PickPage} from '../pick/pick';

pickDefaultDate() {
    this.nav.push(PickPage);
}

pick.html

<ion-list radio-group>
  <ion-item *ngFor="let item of defaultitems">
      <ion-label>{{item.text}}</ion-label>
      <ion-radio [value]="item.value" (click)="pickPreference(item)" ></ion-radio>
  </ion-item>
</ion-list>

pick.ts

constructor(private nav: NavController) {

this.defaultitems = [
      { text: 'No default date', value: 'none' },
      { text: 'Todays date', value: 'today' },
      { text: 'Last date used', value: 'last' }];
  }

dismiss() {
  this.nav.pop();
}

pickPreference(item) {
  this.nav.pop();
}


#2

Hi, I also add the same issue I updated the ionic and now its working fine:slight_smile:


#3

@chandroiud I believe I’m using the latest update. Which version are you using?

Your system information:

Cordova CLI: 5.4.1
Gulp version:  CLI version 3.8.11
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS:
Node Version: v5.10.1

#4

I’m using 2.0.0-beta.25 I was earlier using 2.0.0-beta.23 It had issue with it specifically when using the list component. Also refer to this link: http://ionicframework.com/docs/v2/api/components/nav/NavController at “Page creation” section


#5

@chandroiud the link you provided doesn’t really help. Do you have a sample code where you’re using this.nav.pop() functionality without any issues? I would love to compare your code to mine to see if I’m missing something.


#6

Here my working example of it:

page.html

<button (click)="goBack()">Go Back</button>

page.ts

goBack(){
  this.nav.pop();
}

This goes to the root page


#7

The key is to go back and forth between the parent and child pages as fast as possible. This is when it breaks. Can you try that?


#8

well, I tested it multiple times, In my app I have added a custom back button and it works fine I also have a back and forth navigtation from sidemenu to pages and it works fine. I will check your complete app from github and see if I’m abel to trace the issue.

Does this issue occurs on android and iOS as well? try building the android and iOS version and run it on the phone or emulator, Sometimes it might a browser specific issue.


#9

I was able to reproduce this on my phone 6 running iOS 9.3.2. I don’t have android so I could not test it there


#10

Hi, did you find a resolution to your issue? I’m seeing the exact same problem in my app when switching back and forth between views in the nav stack quickly.


#11

Checkout the ionic issue #6677 I submitted a few weeks ago. And also issue #6540. Both are kind of related.
@danbucholtz made a small adjustment to the KEYBOARD_DURATION_PADDING = 600; and that helped. But looks like the behavior is back in Beta.11 as @chack commented. I have tried to break my app but I haven’t experienced the issue again. Sorry I can’t be of more help :smirk:


#12

Thanks for the response. I will follow that issue


#13

Hi there!
Any updates on this?I have the same issues