-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Nav Bar / Back Button / Nav Clear Issues #1525
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
Comments
Hey @Niltz, thanks for the detailed description. For the second issue, that's the appropriate behavior. Each tab group have their own unique history. So if Nav 1 and 2 are both in the same group and I go back to Nav 2, in that history, I'm still on the "detail" view of nav 1, which is what it considers nav 2 and is therefore showing a back button. I may have botched that description, did that make sense? The first issue appears to be a bug though. |
This may be related to ticket #1287 |
@perrygovier, my second issue doesn't use tabs, so I don't know why tab groups would have anything to do with this. Also I don't use |
Good point, I shouldn't have said tabs. The feature is commonly used in tabs, but it's the wrong term. The proper term is escaping me right now, but in: .state('nav.nav1', {
url: "/nav1",
views: {
'navContent' : {
templateUrl: "nav1.html"
}
}
}) 'navContent' sets what "group" that state belongs to, so nav.nav2 and nav.nav1 are considered related and will share a history. |
sibling states perhaps? So, why doesn't nav-clear in nav.nav2 work? Shouldn't that clear the current nav-bar's history before navigating? Or maybe I don't understand what nav-clear is supposed to do. |
I'm not really sure. I'm not the best at the router and how it work with the inner workings of the parallel histories. @ajoslin might be a little more well spoken on the topic than I. |
Regarding my second issue (where the nav-clear directive doesn't seem to hide the back button), looking at the navClear directive in Ionic, it has the following code:
maybe in some cases the Maybe we are getting confused with "nav-bar history"? I'm not talking about the browser navigation history. I'm talking about the ion-nav-bar directive, it's history, and the ion-nav-back-button directive. |
Greetings @Niltz! Sorry but this issue may no longer be applicable to recent versions of Ionic. If you are still experiencing this issue, please feel free to reopen and provide the following information so that I may assist you.
Additionally, providing a codepen which replicates the issue is extremely helpful. If you wish to get help using the framework itself, the recommended place is the forum. Thank you for allowing me to assist you. |
I have found a couple issues with the ion-nav-bar/ion-nav-back-button/nav-clear. I'm not sure if they are related or not, so I will describe them both
First issue - Sometimes the back button isn't visible when it should be
See this codepen
And follow these steps:
The "Account Sub" link does not have a nav-clear, so the navigation history should not get cleared.
Second issue - Sometimes the back button is visible when it shouldn't be
See this codepen
And follow these steps:
The "No Nav" has a nav-clear, so shouldn't the nav-bar history be removed? Also, the ion-nav-bar is completey removed when going to "No Nav" so I would expect that the ion-nav-bar history would be cleared.
The text was updated successfully, but these errors were encountered: