Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavController pop don't work and webview black #9022

Closed
tunxiaoqing opened this issue Nov 4, 2016 · 8 comments
Closed

NavController pop don't work and webview black #9022

tunxiaoqing opened this issue Nov 4, 2016 · 8 comments

Comments

@tunxiaoqing
Copy link

when webview has ion-tabs, if current webview runs 'NavController pop', the target webview turns black.
ionic version : ionic2RC2.
looking forward your help!!!
as follows:
1
2
3
4

@manucorporat
Copy link
Contributor

If you just have one view in the navigation stack and you pop it, there are 0 views in the stack right?
So it gets black. I will add some kind of error message. Leaving this open.

@tunxiaoqing
Copy link
Author

I wrote a demo to illustrate my problem.The program has 5 component Page1 Page2 Page3 Page4 and TabsPage.The Page1 is the root page ,click [Click me to Tabpage] will push Page2 to the stack,and the stack length is 2 in Page2 click[Click me to TabPage] will push TabPage to the stack and it's length is 3., the TabPage has two tabs——Page3 and Page4. but when I enter the Page4 .the stack length is 0.I click [go back] It shows black screen jsut as follow.I can'tback to the Page2. Is there anything wrong with me?
Sorry my English is poor .
vji4bvok9 kyh0qe d1uk k
wda7kh37idu0 4_soqrgb t
a me4n 6dw8 7s f6 c
eig ko8l bu 4k4dl 4y w
5t6 69 boiu538 0 6 8
5t6 69 boiu538 0 6 8 1

@tonyawad88
Copy link

I have a similar problem described in here as well: #8713 .

I am going to start calling it the black screen of death :-) . I basically have the following code on my tabs page.

_HTML_

<ion-tabs color="darkblue" #myTabs class="test">
  <ion-tab [root]="tab1Root" tabTitle="HOME" tabIcon="home2" class="home2" (ionSelect)="TabSelect(0)"></ion-tab>
</ion-tabs>

_TS_

@ViewChild('myTabs') tabRef: Tabs;
TabSelect(index){
    this.tabRef.getByIndex(index).popToRoot({animate:true});
  }

Any way of checking on our side if a tabs nav stack has any views in it before popping ? @manucorporat

Thank you !

blackbg-on-poptoroot

@tonyawad88
Copy link

As a workaround I ended up using this:

if(this.tabRef.getByIndex(index)._views.length > 1){
      this.tabRef.getByIndex(index).popToRoot({animate:false});
}

@solsticesurfer
Copy link

The cause of this seems to be a change in what the NavController is. When a tab controller is on a page, the TabController is passed to the page's constructor as the NavController. This is what's causing the pop to fail. The TabController has a different nav stack and when pop() is called, either explicity on the NavController instance or by using the navPop decorator, the request fails as the stack is empty.

The failure can be prevented, of course, by checking NavController.canGoBack(), but this doesn't solve the problem that the NavController provided to the constructor is not the one that is expected.

Knowing this, what is the more appropriate approach?

@BramDecuypere
Copy link

Is there any progress in this issue?

@seetadev
Copy link

We are observing this issue in ionic 3.0.1 as well i.e. black screen upon navigating back to the root page.
This is my package.json
Package.json

The issue with the error log is shown below:
Issue
Blank Screen

@ionitron-bot
Copy link

ionitron-bot bot commented Apr 20, 2018

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

@ionitron-bot ionitron-bot bot closed this as completed Apr 20, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants