iOS freeze when pressing back, on 2 levels deep

I am having a problem with iOS only, but I think it is also on android but I can’t replicate the behaviour.

the problem consists of:

  • I’m on the dashboard which is a tabbed page, a go to page 1.
  • page 1 loads async values in “ionViewLoaded” event, but first it calls the present loading.
  • present loading gets dismissed, on observable subscribe complete
  • I click on one of the results and go to page 2, same thing loading shows and gets dismissed on subscribe complete.

Now the error:

  • from page 2 when I click (back) on iOS it, acts like a double back, meaning it goes back to page 1 but hangs the dashboard on the middle of page one.

I can only test on the emulator iOS 9.3 iphone 6, since I dont have an iphone available

I have tried:

  • disabling the swipe to back (swipeBackEnabled=“false”) on all the 3 tabs. I tried this because I thought that when I pressed back it was somehow dragging the click to simulate a swipe gesture, making it go back again and freezing.
  • I used to have the async data load from page 1 in the ngOnInit event, making it load again everytime it entered the page, switch it to ionViewLoaded so that it only loads on enter to, not when going back to.

None of those work. Another one I’ve tried is setting the “pageTransitionDelay” in the ionicBootstrap config, to 200 milliseconds, (I hate it because it makes the app look slow), and that kinda looks like it wants to work but, the behaviour changes to instead of doing a double back it will do the animation of page 2 leaving (and if you tap a couple of time when the animation is running), it will leave and appear again on top. basically it shows page 2 leaving but then it appears back on top, this only happens if you tap while the animation is happening

I have this same problem. I am using Ionic 2 beta 11. It seems to happen when navigating back and forth between a view that has some observable on it, when going back real quickly the page which I am trying to go back to appears to transparently freeze half way over the current view. This is with both iOS 9 an iOS 10 beta 8.

I am having the same problem.

Same exact problem here.

I found out the problem is related to the page transition rather than to iOS only (in fact forcing ‘ios’ for page transition produces the same exact problem for android when emulating it in chrome).

I managed to solve it in some way (beta 11) with this workaround:

in app.ts instead of calling ionicBootstrap(MyApp);

use:

ionicBootstrap(MyApp, [], {
pageTransition: ‘md-transition’
});

so as to force the android page transition for each platform.

There’s still a small glitch for iOS when going back on the stack (in some cases 2 pages are popped rather than 1) but it’s a decent solution at least for me

2 Likes

I no longer have the problem since moving to the release candidate.