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

bug: Nav-bar sometimes disappears after destroying and re-launching the app #3483

Closed
mrozlukasz opened this issue Apr 8, 2015 · 16 comments
Closed

Comments

@mrozlukasz
Copy link

Type: bug

Platform: mobile webview

# Tabs seed

I wrote an app based on tabs seed. The nav-bar seems to disappear sometimes after I close my app and relaunch it.

Steps

  1. I launch my app, login and display the dashboard screen.
  2. Close the app or reinstall it with (ionic run ios; ionic run android)
  3. Sometimes app opens but without nav-bar (it's hidden)

I use $state.go with dashboard cache disabled. The issue is random and it happens on both platforms.
This is production showstopper for me. I try to find some workaround but the FIX is needed here. To be more precise, the nav bar gets the hide class and the whole ion-view is repositioned like it was no nav-bar.

Additional info

"cordovaPlugins": [
    "org.apache.cordova.device",
    "org.apache.cordova.console",
    "com.ionic.keyboard",
    "org.apache.cordova.splashscreen",
    "org.apache.cordova.inappbrowser",
    "./engine/cordova-crosswalk-engine-c0.6.2",
    "org.apache.cordova.statusbar",
    "uk.co.workingedge.phonegap.plugin.launchnavigator",
    "org.apache.cordova.geolocation",
    {
      "id": "org.crosswalk.engine",
      "locator": "./engine/cordova-crosswalk-engine-c0.6.2"
    }
  ]

@mrozlukasz mrozlukasz changed the title Nav-bar sometimes disappears after destroying and re-launching the app bug: Nav-bar sometimes disappears after destroying and re-launching the app Apr 8, 2015
@vnagasivam
Copy link

Our app has the same issue as this. Which version of ionic are you using? We've noticed that in ionic beta-14 the issue is not present, but we can reliably reproduce it with rc1 and rc2 on a device by killing and relaunching the app. Also using $state.go to redirect to a user's dashboard when re-opening the app.

@mrozlukasz
Copy link
Author

I found some workaround, but it's not ideal for all apps. I replaced the ion-nav-bar with fixed ion-header-bar from http://ionicframework.com/docs/api/directive/ionHeaderBar/ and it does not disappear. It was possible because my app was not using any features from nav-bar like history. Happily the app can go to production, but IMHO the bug is a critical issue for ionic stable release.

@perrygovier
Copy link
Contributor

@mrozlukasz do you see this in an app using the tab seed by initially? Can you share a project that reproduces the error so we can inspect it?

@perrygovier perrygovier added the needs: reply the issue needs a response from the user label Apr 14, 2015
@mrozlukasz
Copy link
Author

@perrygovier the seed app is working fine. I've noticed that ion-nav-title/ion-nav-buttons used among multiple tabs causes the issue somehow. I'll try to separate the code/edit the tabs seed for you this weekend. Thanks.

@Ionitron Ionitron removed the needs: reply the issue needs a response from the user label Apr 15, 2015
@mhartington mhartington added the needs: reply the issue needs a response from the user label Apr 16, 2015
@iver56
Copy link

iver56 commented May 2, 2015

Here's a video where I show how this bug can be reproduced in my app:
http://iver.io/stuff/ag/WP_20150411_001.mp4

Here's what I do:
I'm inside Chrome and I tap a deep link to open the app. Then I tap the back button twice. The second tap closes the app and I see Chrome again. Then I click the deep link again. The app opens once again. Problem: The nav-bar is not visible. Happens every time I do this, i.e. it's not random.

The second back button tap (the one that closes the app) is actually calling navigator.app.exitApp();

OS: Android 4.1

Edit: I don't know if it's relevant, but the first view (the one with the list of badminton events) has hide-nav-bar=true

@Ionitron
Copy link
Collaborator

Greetings @mrozlukasz!

My sensors indicate a reply was requested, but we have not received one yet, I am using my robot powers to close this issue. However, if you are still experiencing this issue, please feel free to reopen it by creating a new issue, and include any examples or necessary information.

Thank you for allowing me to assist you.

@Ionitron Ionitron added ionitron:closed and removed needs: reply the issue needs a response from the user labels May 16, 2015
@rajatrocks
Copy link

I noticed that when I deleted and reinstalled my app on device, on first load the navbar would be gone. On all subsequent loads it would be fine. Turns out that in some of my controller code that ran at startup, it was trying to access an object that didn't exist yet, that was throwing a silent JS error which then screwed up the navbars for some reason (by preventing a call to self.createHeaderBar with isActive= true). On subsequent loads that object did exist, and therefore no problem. Fixing the bug fixed the navbar issue.

Remote debugging with Chrome and an Android phone is great. You can see stuff in the console that was logged before you even opened Developer Tools. Unlike Safari's debugging, where catching startup problems is pretty much impossible.

@hswolf
Copy link

hswolf commented Oct 14, 2015

I found that these code will make this kind of problem fly away

$scope.$on('$ionicView.enter', function(e) {
    $ionicNavBarDelegate.showBar(true);
});

My solution is just show it whenever view is entered.

@balicekt
Copy link

Thanks @hswolf this figured out my issue!!!

@obedm503
Copy link
Contributor

problem with this solution is that the nav-bar appears empty, no title, no back button, no side menu button

@jorgevaldivia
Copy link

I'll throw in my 2 cents here. I was having this exact same problem until I realized that I had multiple ion-nav-bar elements defined in my app. I had one defined at the root level template and two or three others scattered around the child templates (probably from copy and pasting). The problem went away once I removed the ion-nav-bars from the child templates.

@Paul-Lo
Copy link

Paul-Lo commented Jun 26, 2016

@hswolf solved my problem.

@Medkhalil97
Copy link

@hswolf can you please tell me where i should past that code ?

@jacprada
Copy link

jacprada commented Mar 3, 2017

@Medkhalil97 just paste it in the controller associated with that view. :)

@edeortuzar
Copy link

Thanks @hswolf!!!

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 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