RC0 IOS Swipe to go back with nested states shows blank screen


#1

I noticed that if you have a parent/child state relationship as below, ios swipe to go back will show a blank white screen (the parent view) . This happens regardless of whether or not the parent state is declared as an abstract state. Anyone else seen this?

app.js

$stateProvider
    .state('parent', {
      url: '/parent',
      templateUrl: 'templates/parent.html',
      controller: 'SharedCtrl'
    })
    .state('parent.child1', {
      url: '/child1',
      templateUrl: 'templates/child1.html'
    })
    .state('parent.child2', {
      url: '/child2',
      templateUrl: 'templates/child2.html'
    });

HTML

parent.html

<ion-view>
    <ion-nav-view></ion-nav-view>
</ion-view>

child1.html

<ion-view>
    <ion-content>
        Child 1
    </ion-content>
</ion-view>

child2.html

<ion-view>
    <ion-content>
        Child 2
    </ion-content>
</ion-view>

Go to last state not working
#2

Has anyone seen ios swipe to go back work with nav-view and child states??


#3

we meet same issue…


#4

+1

I’m experiencing the same issue with RC0, @djett, it would be great if you add a codepen link :smile:


#5

I’ve found https://github.com/driftyco/ionic/issues/3317


#6

great thanks @olasfar . I don’t think a codepen will do much help here since it’s only a feature enabled in cordova webviews. Plus like you pointed out, looks like it’s a known issue


#7

+1
We have the same problem with 1.0.0 uranium-unicorn. Is very disappointing because we will have to turn off swipe to go back. If you swipe back several times between different views with different nesting levels the navigations breaks.


#8

Is it possible to move away from child states or are they absolutely necessary for your app? I found that mine weren absolutely necessary and I was able to refactor so I could have swipe to go back.


#9

Hi @djett,

Well, I’m using the child states to simulate inheritance. I have a set of views that share certain behavior and functionality, and I use child states to encapsulate that code.

But it seems a good idea to look for a work arround to child states, because apparently transitions are not working well, the first time the App enters from a normal view to a child view the child view turns black.

Why you were using child states and what technique you’re using now?


#10

Yeah transitions are cleaner with non-nested states. I am using a flat structure for states now rather than nested states.

If you need to reuse HTML you should still be able to use ng-include