-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Hidden tab attribute for ion-tab elements #1666
Comments
Hey @ducdigital, what would the use case be for a hidden tab item? I used them before in a personal project, but later found it was unnecessary. Hiding tab elements feels like a bandaid solution to something Ionic should do better in the first place, or the app's routes could be organized differently. |
See also : Issue #1163 This is a pretty common request. For example, I want the GUI to ALWAYS show the tab bar. However, I have a view that I don't want accessible via the tab bar. Within the GUI, I want to be able to show that view. A hidden tab allows me to :
The alternative of a different state outside the "tab." means a navigation event happens, taking the user away from the tabs, and now, they have to use a back button to get back inside of just tapping a tab. A few other examples of people requesting this:
|
Just found another request : Issue #1673 |
Thanks Ionic team. Here's a sample CodePen for anyone stumbling across this |
Saved my hair :) |
Does anyone know how to properly hide and show tab items? Like a method to toggle them individually? I found it : http://codepen.io/anon/pen/DqyeI?editors=101 Btw, the mix of Github's issue centre and the Ionicframework's forum can be kind of confusing to navigate and figure out solutions! I love all the codepens tho! |
It is related if you think about. My scenario, described here, it a little bit different. I want all tabs to be visible at all times, but I don't want to link all my states to one particular tab. All my states, except each root tabs states, should be rendered in the current selected tab. Did I made this up? No... Facebook (iOS) does exactly that. They have a set of fixed tabs and all other "states/views" are rendered in the active tab. - it's genius. Unfortunately, I wasn't able to hack things around to make this work (tried a few things, like creating views state object on the fly...). For example |
Hi,
but no luck. |
hi, @elineopsommer did you figure it out? For now I used some css to achieve this: |
@MrFragStealer Your solution works, but isn't very dynamic or programmatically controllable. I think, this Directive is cleaner: |
@MrFragStealer thanks it works |
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. |
This will help people able to implement both side-menu and ion-tabs at once.
In the file: ** js / angular / directive / tab.js **
Change:
tabsCtrl.$tabsElement.append($compile(tabNavElement)($scope));
to
if ($attr.hidden !== 'true') { tabsCtrl.$tabsElement.append($compile(tabNavElement)($scope)); }
This allow a hidden="true" attribute in the ion-tab element. It will hide the button but view/controller will continue to works as normal. We can access it by route or other mean like a normal tab.
I hope we can implement this if there are no problem :)
The text was updated successfully, but these errors were encountered: