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

Back button does not appear when navigating to nested view

Open CoenWarmer opened this issue 12 years ago • 51 comments

When navigating to a page with tabs, the header does not display the back button.

Mentioned this on the forum at: http://forum.ionicframework.com/t/ui-router-question-related-to-tabs/555/3

Also on StackOverflow at: http://stackoverflow.com/questions/21218419/trouble-understanding-ui-router-and-nested-views

I've set up this Plunkr to demonstrate the behavior: http://plnkr.co/edit/jKII2S3uEnEOVDy9WBA2

CoenWarmer avatar Jan 19 '14 17:01 CoenWarmer

The back button does not display because when you go into a tab, it enter's it own "history", meaning each tab has its own navigation back and forward.

adamdbradley avatar Jan 20 '14 03:01 adamdbradley

Please correct me if I'm wrong, but I think that means that the offered tabs component in its current form is not suitable in the use case of having multiple pages where some have tabs and some don't.

If it is possible, I'd love to know how it's done. In the meantime I've opted to integrate the three tabs within one view and show/hide them by clicking a link.

CoenWarmer avatar Jan 20 '14 03:01 CoenWarmer

@adamdbradley I think this issue needs to be reopened.

I believe it should be possible to have one page that links to another page that has tabs, and be able to navigate back.

There's a definite upside when this is done via the abstract states instead of using ng-if to show and hide pieces of one page. One being that if you're on a tab with a list the scroll position is remembered for that state. If you use the ng-if method, the wrong tab might be opened when going back, and the scroll position might also be wrong.

It would be super helpful if it's possible to have one page link to another page that has tabs with the abstract router logic.

CoenWarmer avatar Feb 14 '14 11:02 CoenWarmer

https://github.com/driftyco/ionic/issues/601

CoenWarmer avatar Feb 14 '14 11:02 CoenWarmer

+1

I had the same problem with the tabs controller. Took the example from the seed project and was wondering why I didn't get any back button.

zemirco avatar Feb 25 '14 10:02 zemirco

@ajoslin @adamdbradley @mlynch

This issue needs to be reopened, it's still an issue for a very real use case.

It has popped up on the forums again here: http://forum.ionicframework.com/t/ion-tabs-how-to-remember-which-tab-needs-to-be-opened-when-going-back/2230/6

Plunker demonstrating the problem: http://plnkr.co/edit/k09GV3M5PP1TS7U4oNqK?p=preview

CoenWarmer avatar Mar 26 '14 10:03 CoenWarmer

I am having the same problem - I have multiple pages in my app where one has tabs. I need to go back to the page calling the tabs page.

sirenl avatar Apr 03 '14 11:04 sirenl

I don't think the built-in back button is going to be able to support this -or maybe it could with some work. But this functionality does need to work somehow.

Have you tried adding your own button to the navbar's left buttons and having it call window.history.back?

ajoslin avatar Apr 03 '14 11:04 ajoslin

Thank you for your response. Yes, I have tried that. That is only working on the first tab, not the other tabs.

sirenl avatar Apr 03 '14 11:04 sirenl

What would be very helpful would be some examples in setting up views for apps that use tabs on a couple of pages but not as the primary way of navigation. So the homepage has no tabs, but one or more of the following pages do.

CoenWarmer avatar Apr 03 '14 11:04 CoenWarmer

This will be much easier to control in later versions - for now, I don't think we'll support this.

ajoslin avatar Apr 30 '14 18:04 ajoslin

Is there a solution for it now?

http://plnkr.co/edit/k09GV3M5PP1TS7U4oNqK?p=preview

steefaan avatar Nov 26 '14 10:11 steefaan

+1

henry74 avatar Jan 27 '15 18:01 henry74

+1

steven2y avatar Jan 28 '15 15:01 steven2y

+1

piyengar avatar Feb 10 '15 10:02 piyengar

This is basically the same problem as https://github.com/driftyco/ionic/issues/2997

CoenWarmer avatar Feb 10 '15 10:02 CoenWarmer

+1

dylanvdmerwe avatar Feb 18 '15 13:02 dylanvdmerwe

+1

argyleink avatar Mar 06 '15 00:03 argyleink

+1

upwell avatar Mar 09 '15 05:03 upwell

+1

ghost avatar Mar 19 '15 14:03 ghost