ionic-team / ionic-v1

The repo for Ionic 1.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
193 stars 187 forks source link

Occasional white screen on ios when navigating quickly via $state.go() #119

Open jgw96 opened 7 years ago

jgw96 commented 7 years ago

From @antpuleo2586 on June 20, 2016 16:4

Short description of the problem:

When I navigate between views, I occasionally get a white screen on ios. Usually I can reproduce this by tapping between views too quickly, but it also happens intermittently when navigating normally.

What behavior are you expecting?

The view to appear as normal.

Steps to reproduce:

  1. Navigate from one view to another

Other information: I can't reproduce this using a plunker, but I do have some further information: When I inspect with Safari, the <ion-view> element completely disappears and seems to be replaced with a <div> like this: <div class="pane" nav-view="entering" style="-webkit-transition: 0ms; transition: 0ms; transform: translate3d(0%, 0px, 0px); opacity: 1;"></div>

Here are two screenshots showing this: Before: https://www.dropbox.com/s/ypxdcfwjveodltm/ionic%20ios%20before.png?dl=0 After: https://www.dropbox.com/s/cc04qx5ncd0klpk/ionic%20ios%20after.png?dl=0

I'm using crosswalk but this problem doesn't occur on android at all. Also doesn't occur when I serve the app in a web browser. I even removed crosswalk and get the same issue.

Which Ionic Version? 1.3.1

Run ionic info from terminal/cmd prompt: (paste output below) Cordova CLI: 6.1.1 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 1.3.1 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 ios-deploy version: 1.8.6 ios-sim version: 5.0.4 OS: Mac OS X El Capitan Node Version: v5.6.0 Xcode version: Xcode 7.3.1 Build version 7D1014

ios version: iPad: 8.4 and iPhone: 9.2

Has anyone had this problem or can anyone explain why this might be happening/how I can fix?

Thanks!

Antonio

Copied from original issue: driftyco/ionic#6976

jgw96 commented 7 years ago

From @leroygumede on October 10, 2016 10:43

Did you ever find a fix to this ? @antpuleo2586

jgw96 commented 7 years ago

From @antpuleo2586 on October 10, 2016 10:49

@leroygumede No, are you having the same problem?

jgw96 commented 7 years ago

From @leroygumede on October 10, 2016 10:55

@antpuleo2586,YES, and your right about it happening randomly , I tried this method but it seems not to work on android devices

        $timeout(function() {
            $ionicHistory.clearHistory();
            $state.go('tabsController.home');
        }, 300);
jgw96 commented 7 years ago

From @antpuleo2586 on October 10, 2016 11:27

@leroygumede Ah ok, well this problem only happens to us on iOS devices. I'll try your method, cheers.

jgw96 commented 7 years ago

From @leroygumede on October 10, 2016 12:53

@antpuleo2586 After much researching I found the Issue #3216 unfortunately the solution is not too use cache: false 👎

jgw96 commented 7 years ago

From @antpuleo2586 on October 10, 2016 14:43

@leroygumede Thanks for the advice, but unfortunately it's still crashing for us, even when using cache-view="true". Back to the drawing board..

jgw96 commented 7 years ago

From @leroygumede on October 10, 2016 15:13

@antpuleo2586 This worked perfectly for me. I removed all the cache-view="false" then added the following

$ionicHistory.clearCache().then(function() { $state.go('tabsController.home') });

jgw96 commented 7 years ago

From @antpuleo2586 on October 10, 2016 15:52

Thanks @leroygumede but still the same for me. It's really an edge case thing, if I tap too quickly on the button to navigate back, I can recreate it quite easily now :/

jgw96 commented 7 years ago

From @antpuleo2586 on December 5, 2016 12:24

Hey @leroygumede We get this error via safari: "Gesture: Failed to receive system gesture state notification before next touch" Which seems to be the cause of the white screen for us; have you ever seen this?

Cheers

mirko77 commented 7 years ago

We have been having multiple reports of this problem happening now that our app is released and the user base is growing. Only iOS, not a single issue on Android.

We tried the WKWebView plugin as well but it makes not difference. It would be good to know if there is any workaround. @jgw96

tobeee commented 7 years ago

Did anyone find a fix for this? Happens sometimes here and no idea why

mirko77 commented 7 years ago

@tobeee it is related to something Ionic added only for iOS, go figure why.

After countless hours of debugging, we were able to fix it with:


//the following hack fixes the random white screen when tapping quickly
        if (window.device) {
            if (window.device.platform === PARAMETERS.IOS) {
                console.log('iOS hack done.');
                $ionicConfigProvider.views.maxCache(0);
                $ionicConfigProvider.views.swipeBackEnabled(false);
            }
        }
Grohden commented 6 years ago

@mirko77 your issue seems to be related to this ionic-team/ionic#3317

This issue is happening to me too, and what i can think about is that when you tap too fast in the action bar, you end up using the swipe back gesture without knowing, i can't confirm that, but the solution could be add a provider option to disable the swipe back only in the action bar (?)

tobeee commented 6 years ago

We fixed the issue by completely removing caching as mentioned above - bit of a shame but only choice!

On Thu, Jan 4, 2018 at 1:52 PM, Gabriel Rohden notifications@github.com wrote:

@mirko77 https://github.com/mirko77 your issue seems to be related to this ionic-team/ionic#3317 https://github.com/ionic-team/ionic/issues/3317

This issue is happening to me too, and what i can think about is that when you tap too fast in the action bar, you end up using the swipe back gesture without knowing, i can't confirm that, but the solution could be add a provider option to disable the swipe back only in the action bar (?)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-v1/issues/119#issuecomment-355287167, or mute the thread https://github.com/notifications/unsubscribe-auth/ABxI8BwUWt03_dcD5LWi1pdasOMtu1Cmks5tHNedgaJpZM4LjXWZ .

-- Toby Green

mirko77 commented 6 years ago

@Grohden removing only the swipe gesture was not working for us, we had to remove the cache as well.