md-content in tab do not scroll
Here is a plunker that describes the problem : http://plnkr.co/edit/v9mzICm4Lip2C1xxtvl3?p=preview
The content of tab 1 is owerflowing the md-content area and appearing under the md-card below. The expected behaviour is for the md-content are to scroll the same way as it does in the md-card component below
@rschmukler @hkgrani I'm trying to use md-tabs with internal tab content and notice that the Tabs scroll with the internal md-tab content. Is this intended behavior?
My understanding is that internal tab content should scroll similar to how content in md-content scrolls, no?
Otherwise, the user is not able to switch back and forth between tabs without scrolling all the way to the top of the area with tab content. See image below:

I modified the Plunkr above to use the latest Angular (1.3.14 at time of writing) as well as increase the # of items in the md-tabs area: http://plnkr.co/edit/8rsY6ZMJle0li5kSwH9D?p=preview
Also, I've noticed in both the Plunkr above AND the current md-tabs demo, https://material.angularjs.org/#/demo/material.components.tabs, that a scrollbar appears in the header of the tab control versus in the body for tab content (see image below). I'm using the latest version of Chrome (so the scrollbars disappear when I try to take a screenshot but it's easy to see and repeat on the angular demo website).

I was able to "somewhat" get things working by doing the following:
- Set
layout="column"(or add the two css styles shown below) on the<md-tabs>element.
flex-direction: column;
display: flex;
It then creates a flex-column where .md-header class is maintained at the top of the parent div.
- Set
overflow: scrollon the.md-tabs-contentclass. This then allows the internal tab content to scroll.
See this plunkr: http://plnkr.co/edit/wr4cuu2L1csgybv6x2TO?p=preview
Unfortunately, by setting layout="column" on md-tab, the style of the tabs is affected and the tabs do not display nicely:

I was able to fix this as well. Since md-tabs is now using layout="column" and the .md-header height is set explicitly in the angular-material design css: https://github.com/angular/material/blob/517623e721cd1d9a104aec2bee22a23889944b3a/src/components/tabs/tabs.scss#L13-18
We can use flex to correctly fit/align everything by updating the .md-tabs-content style:
.md-tabs-content {
display: flex;
flex: 1;
overflow: scroll;
}
See this plunkr: http://plnkr.co/edit/jWLQMIA4ouDDVhL1k4Zc?p=preview
I'm not sure how this "fix" affects the other styles/properties/configuration of md-tabs but when I apply these styles in my own application, I'm able to get a correctly sized tab header (with tabs) as well as scrolling internal tab content without scrolling the tabs out of view on the parent element container.
One follow-up to my last comment.
Using the CSS adjustments above, I'm now able to:
- Show tab headers
- Have internal tab content scroll without the tab headers scrolling out of view.
However, I've noticed that the scroll offset is identical across tabs. This is because I'm setting overflow: scroll on the overall md-tabs-content class which contains all internal child tab content. By scrolling you're actually scrolling the parent container not each individual container.
I was able to fix this by tweaking the styles described above and creating a more structured "flex" layout down through the hierarchy of elements:
md-tabs { // Based on earlier post, required to allow scrolling internal tab content
display: flex;
flex-direction: column;
}
.md-tabs-content { // Based on earlier post, required to get `.md-header` to show correct 'tabs' height
display: flex;
flex: 1;
flex-direction: column;
}
.md-tab-content { // New style adjustment with flex direction set to row to allow tab contents to flex the horizontal space as well as overflow-y to allow tab content to scroll
display: flex;
flex-direction: row;
flex: 1;
overflow-y: scroll;
}
Here is a plunkr now showing correctly sized and independent scrolling tabs (since we're now using md-tab-content overflow instead of its parent's).
http://plnkr.co/edit/jWLQMIA4ouDDVhL1k4Zc?p=preview
NOTE: I removed the md-content elements from the Plunkr demo above.
I'm not sure how the angular material design team wants to handle scrolling of content in a md-tab. Do you want to support default scrolling (by setting overflow-y: scroll above on the md-tab-content class)? Or would the team prefer people use a md-content element as the root of their internal tab content if they want scrolling?
If the latter, here is a demo where I've re-added the md-content element in the first tab and removed overflow-y scroll on the md-tab-content class. This allows us to show the first tab scrolling while the second tab only shows the first section of the list (since the md-list is not contained inside an md-content element).
http://plnkr.co/edit/7ZkDIQFunka9MMtrr2pd?p=preview
@rschmukler your fix (https://github.com/angular/material/commit/dec2ac42ebec04070e81fe1a664e7be906f0b4a4) was overrided by https://github.com/angular/material/commit/f34eb800212b6daa11d3a23c14a5a173d9691cf3
I think tabs should allow scrolling content within. Here is a possible fix: md-tab-content { overflow: auto; }
If you create 2 tabs. use 1 tabs set just for the label and the other tab just for the content. this would work if you use the same md-selected model for both.
so for the content tab just add this rule to hide the labels.
.tabs-no-label > md-tabs-wrapper {
display: none; // hide labels
}
i have done it here. http://entertainjs.herokuapp.com/ . sorry i dont have enough time to make it into a nice jsfiddle haha.