Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular material design md-tab scroll content

This might be a simple issue, but I'm new to this...

I am trying to have an md-tabs element that takes the entire screen, and have only the tabs' content scroll. Here is an example on jsFiddle

Any ideas? thx!

like image 489
YWsecond Avatar asked Oct 19 '22 15:10

YWsecond


1 Answers

Try this:

<body ng-cloak layout="column" ng-controller="AppController as app">
    <md-toolbar layout="row" class="md-toolbar-tools">
        <h1>Welcome!</h1>
    </md-toolbar>
    <div layout="column" flex>
        <md-tabs md-stretch-tabs="always" flex>
            <md-tab label="Tab1">
                add our larger-than-life content here
            </md-tab>
            <md-tab label="Tab2">
            </md-tab>
       </md-tabs>
    </div>
</body>

Adding the flex attribute to md-tabs will make the content of the inner tabs (md-tab) scrollable.

like image 73
Ben Avatar answered Oct 27 '22 10:10

Ben