Back button missing sometimes

I have tried searching for this but I haven’t quite found anyone who has described my issue in a way that I am experiencing it.

Description of my “problem”:
When I select a link on page 1 to go to page 2, page 2 loads as expected (including a back button). If I then go back to the sidemenu and again load up page 1 and go to page 2, the back button disappears.

After this, I have also noticed if I AGAIN go back to page 1 and select the link to page 2, the back button is there again.

link to gif showing issue


VigorousFixedFoal

I personally think I am misunderstanding states but I am not sure where. Also keep in mind this is the default sidemenu project. Any help would be appreciated

1 Like

Could you provide some code ?

Sure, I can try out that code pen thing. I’ll brb with that. If you want to see it on your local machine all you have to do is ‘ionic start [name] sidemenu’

edit: link to example: http://embed.plnkr.co/vVjg9g/preview

I’ve verified this behavior and it does seem to be a bug. No errors are logged in the console.

I have the exact same problem right now. After some random navigations back and forth, at some point the back button vanishes. I have a menu and after selecting a menu entry with nav-clear, the history is okay again, the back button is back and everything works good.

Cordova CLI: 5.1.1
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.8.11
Ionic Version: 1.0.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
ios-deploy version: 1.7.0
ios-sim version: 4.1.1
OS: Mac OS X Yosemite
Node Version: v0.12.7
Xcode version: Xcode 6.4 Build version 6E35b

Tested on iPhone 5S and in Bowser.

HI All

Is this the same problem. http://codepen.io/anon/pen/xGJvrj

"pressing home button twice breaks the back button on the “right button” page.

Click the “right button” and you go to a page with a back button as expected. Go back to home page and then select home twice or three times ( more then once ) from the left menu. Now press “right button” - no back button

Is this a bug I should report? I am not sure what should happen now.

I had a similar issue with the Ionic framework’s v1.0.0-beta.14: Rob Ferguson

I recently started on an new app using:

$ ionic info

Your system information:

Cordova CLI: 5.1.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
ios-deploy version: 1.7.0 
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.5
Xcode version: Xcode 6.4 Build version 6E35b 

I started with the sidemenu template: Rob Ferguson

And, then I went through the code and fixed things like using ‘ui-sref’ and not ‘href’, for example: https://github.com/Robinyo/Vardyger/blob/master/core/client/app/templates/side-menu-template.html

See, also: Rob Ferguson

@yewnork - Its a BUG :frowning:
@cormacodonnell
@DonEllingsworth
@harmonics

See this fork of your Plunker: http://plnkr.co/edit/JVvifeOX5VSDGoa8lrTJ?p=preview

I updated the Plunker to use 1-0-1 (1.0.1 “vanadium-vaquita” released!) which didn’t work so I checked my bower.json and noticed that I am still using:

"ionic": "v1.0.0-rc.3"

which works, index.html:

<link rel="stylesheet" href="http://code.ionicframework.com/1.0.0-rc.3/css/ionic.css" />
<link rel="stylesheet" href="style.css" />
<script src="http://code.ionicframework.com/1.0.0-rc.3/js/ionic.bundle.js"></script>

Note: I also updated from href to ui-sref in several files + fixed ‘menu.html’ as well :slight_smile:

@bdw

Take a look at the Plunker’s menu.html:

  <ion-list>
    <ion-item nav-clear menu-close href="#/app/search">
      Search
    </ion-item>
    <ion-item nav-clear menu-close href="#/app/browse">
      Browse
    </ion-item>
    <ion-item nav-clear menu-close ui-sref="app.playlists">
      Playlists
    </ion-item>
  </ion-list>

You will get the ‘two menu items’ if you tap ‘Search’ or ‘Browse’ but not when you tap ‘Playlists’.

When using ui-router you should only use ‘ui-sref’ or $state.go() and NOT 'href.

1 Like

This explains a missing back button I was having under 1.0.1 in testing some code as well.

I noticed in your plunker with 1.0.0-rc.3 that when you select a side menu item I get two menu icons, was that the expected behaviour for the demo ?

I’m using Chrome Version 44.0.2403.89 (64-bit)

@bdw

Take a look at the Plunker’s menu.html:

  <ion-list>
    <ion-item nav-clear menu-close href="#/app/search">
      Search
    </ion-item>
    <ion-item nav-clear menu-close href="#/app/browse">
      Browse
    </ion-item>
    <ion-item nav-clear menu-close ui-sref="app.playlists">
      Playlists
    </ion-item>
  </ion-list>

You will get the ‘two menu items’ if you tap ‘Search’ or ‘Browse’ but not when you tap ‘Playlists’.

When using ui-router you should only use ‘ui-sref’ or $state.go() and NOT ‘href’.

So, update the Plunker’s menu.html, as follows:

  <ion-list>
    <ion-item nav-clear menu-close ui-sref="app.search">
      Search
    </ion-item>
    <ion-item nav-clear menu-close ui-sref="app.browse">
      Browse
    </ion-item>
    <ion-item nav-clear menu-close ui-sref="app.playlists">
      Playlists
    </ion-item>
  </ion-list>

And, it will work correctly with Ionic 1.0.0 (and 1.0.0-rc.3) but not 1.0.1:

<link rel="stylesheet" href="http://code.ionicframework.com/1.0.0/css/ionic.css" />
<script src="http://code.ionicframework.com/1.0.0/js/ionic.bundle.js"></script>

@bdw

I also had to update the templates, and a few other things.

Plunker “Playlists - Ionic v1.0.0”: