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

Hide back button by default #638

Closed
adamdbradley opened this issue Feb 19, 2014 · 12 comments
Closed

Hide back button by default #638

adamdbradley opened this issue Feb 19, 2014 · 12 comments
Milestone

Comments

@adamdbradley
Copy link
Contributor

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

@adamdbradley adamdbradley added this to the 0.9.26 milestone Feb 19, 2014
@adamdbradley adamdbradley assigned ajoslin and adamdbradley and unassigned ajoslin Feb 19, 2014
@sicsol
Copy link

sicsol commented Feb 20, 2014

i'm noticing this issue as well

@ajoslin
Copy link
Contributor

ajoslin commented Feb 21, 2014

Fixed.

@ajoslin ajoslin closed this as completed Feb 21, 2014
@guillermin
Copy link

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?

@ajoslin
Copy link
Contributor

ajoslin commented Mar 7, 2014

What's the markup for your ionNavBar?

@guillermin
Copy link

<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>

@ajoslin
Copy link
Contributor

ajoslin commented Mar 7, 2014

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

@guillermin
Copy link

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.

@ajoslin
Copy link
Contributor

ajoslin commented Mar 7, 2014

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

@guillermin
Copy link

.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'
  });

@ajoslin
Copy link
Contributor

ajoslin commented Mar 7, 2014

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)

@guillermin
Copy link

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

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 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 6, 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

4 participants