ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Hide back button by default

Open adamdbradley opened this issue 12 years ago • 12 comments

The back button should be hidden by default so it doesn't flicker on initial page loads.

adamdbradley avatar Feb 19 '14 21:02 adamdbradley

i'm noticing this issue as well

sicsol avatar Feb 20 '14 05:02 sicsol

Fixed.

ajoslin avatar Feb 21 '14 18:02 ajoslin

I updated Ionic and now my back buttons are hidden (class="hide"), which I am guessing is because of this "Hide back button by default". So, how do I show it now?

guillermin avatar Mar 07 '14 00:03 guillermin

What's the markup for your ionNavBar?

ajoslin avatar Mar 07 '14 00:03 ajoslin

<ion-nav-bar type="bar-light" 
  back-button-type="button-icon button-clear" 
  back-button-icon="ion-ios7-arrow-back" 
  align-title="right"></ion-nav-bar>

guillermin avatar Mar 07 '14 00:03 guillermin

That looks right. What kind of navigation are you doing where you expect back buttons and they aren't showing up?

ajoslin avatar Mar 07 '14 00:03 ajoslin

I'm not sure I understand your question, but I arrive at the page I have the nav-bar in through a link. Specifically, a link on "#/cardholder" with href="#/slide-box/card/{{card.id}}" where slide-box is an abstract state with a header (where the back button should be to take you back to "#/cardholder") and a slide-box in the content.

guillermin avatar Mar 07 '14 00:03 guillermin

It's gettting a little clearer, Would you mind sharing your state definitions?

ajoslin avatar Mar 07 '14 00:03 ajoslin

.state('cardholder', {
    url: '/cardholder?tag',
    templateUrl: 'templates/cardholder.html',
    controller: 'CardholderCtrl'
  })
  .state('slide-box', {
    url: '/slide-box',
    abstract: true,
    templateUrl: 'templates/slide-box.html',
    controller: 'SlideBoxCtrl'
  })
  .state('slide-box.card', {
    url: '/card/:cardId',
    templateUrl: 'templates/card.html',
    controller: 'CardCtrl'
  });

guillermin avatar Mar 07 '14 00:03 guillermin

OK. I think there's no back button from the nav-view because you are changing from one parent state to another ('cardholder' parent to 'slide-box' parent). The back button works when you're under the same parent state. Think of it like the nav-bar thinks you 'switched tabs' - or switched to a new navigation stack - because your state changed.

You have a couple choices:

  1. Put the cardholder under the slide-box state
  2. Make your own back button on this page (using left-buttons)

ajoslin avatar Mar 07 '14 00:03 ajoslin

OK, I went for option 3 and it is working, thanks!

guillermin avatar Mar 07 '14 00:03 guillermin

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[bot] avatar Sep 06 '18 05:09 ionitron-bot[bot]