[Tabs] Nav bar should paginate labels on overflow
Bug, feature request, or proposal:
Feature request
What is the expected behavior?
"md-tab-nav-bar" component to have same functionality / visual fidelity as the "md-tab-group" component.
What is the current behavior?
The 2 components are disjoint and improvements made in "md-tab-group" component won't show up in the "md-tab-nav-bar" component
What are the steps to reproduce?
See the default demo included in this repository
What is the use-case or motivation for changing an existing behavior?
I am building a large application that uses lazy loaded modules to implement specific features. I want to display specific functionality in tabs. For example we have a customer object which can contain up to 11 tabs which represent specific data pertaining to this customer. The current "md-tab-group" implementation is already looking great (Dynamic height, scrolling, pagination when tabs exceed container width etc..) But with the "md-tab-nav-bar" component none of these features are available.
Which versions of Angular, Material, OS, browsers are affected?
Material 2.0.0-alpha.11
Is there anything else we should know?
Unlike MdTabGroup, MdTabNavBar doesn't own the body, so I'm not sure whether it should support dynamic height. However I would desperately want to have pagination/scrolling and compact mode for narrow screens to be implemented for MdTabNavBar.
Sure, pagination/scrolling would be very nice!
I may be suffering from a related issue. Cant seem to get lists to be independently scroll-able within a tab.
see this plunkr for demo: http://plnkr.co/edit/h67A8ZSeH747E3oYKdv5?p=preview
Interestingly, independently scroll-able lists work fine in md-tab-nav-bar tabs.
Is there a published timeframe for pagination on MdTabNavBar?
Also desperately need this functionality.
Any news?
Also interested in updates as well.
These features is very necessary
any workarounds while we wait? ;) I need this too.. meanwhile I'll try to write my own workaround
My stupid workaround! :) i've used md-tab-group... with style="width:100vw;" and no content... now I just have to style it and add some click-events.
<md-tab-group style="width:100vw;">
<md-tab label="Tab 1"></md-tab>
<md-tab label="Tab 2"></md-tab>
<md-tab label="Tab 3"></md-tab>
<md-tab label="Tab 4"></md-tab>
<md-tab label="Tab 5"></md-tab>
</md-tab-group>
almost one year later ... any news on that ? no wonder why most of the dev move to react ...
@anymos This is an open source project. If you need something, you can always create and use a fork or send a PR. Most projects I work with have more incoming feature requests than developers can implement. I expect this should not be a surprise to many developers.
Please try to keep comments constructive.
I have built a workaround for this issue. I've put the nav bar in a div and I added a overflow-x: hidden and added a display: flex to it. In the component I've taken control of the div and used it's scrollLeft property(div.nativeElement.scrollLeft) Afterwards I added 2 buttons which constrolled the left/right scrolling. It's an easy and quick solution until this issue is resolved fully.
@qwr1000 Hey, could you post a codepen for your quickfix?
@qwr1000 Thanks for the idea! I created a simple component using styles form tab header. Here's the code: http://plnkr.co/edit/8locpYNLpLEDOKxWneY7
Some additions to the superb solution by @oleges
- Turn off left/right arrow buttons if the screen is wide enough
- If screen is wide enough expand the bottom-border line fully
- Also disable wrapping in Firefox
http://plnkr.co/edit/qJTwkJPzriMhKynhRPBS?p=preview
Also came here looking for this issue. Probably naive but this be something that would be a matter of copying the logic from the one component that already works (mat-tab-group) to this one?
This is a great case of getting community contribution. Unfortunately we only have a limited set of resources with lots of higher priority issues/features to work on.
If anyone wants to work on this, here's a branch on my fork that has some work done to refactor the tab header so it can be used by both the tab group and nav bar: https://github.com/andrewseguin/material2/tree/tabs-pagination-refactor
To be honest, not sure that's the final design or best implementation, just playing with it to see what possible. Still needs some cleanup in implementation and tests.
@andrewseguin do you still need help with that fork?
I like https://angular-material-priority-nav.stackblitz.io/ really a lot - can we have that out of the box? pretty please!