简体   繁体   中英

angular material 2 tabs scroll showing on navigation

As you can see in this example when you change tabs vertical scrollbar appears on animation.

<md-tab-group>
  <md-tab label="Tab 1">
    <div style="height: 2000px">Content 1</div>
  </md-tab>
  <md-tab label="Tab 2">
    <div style="height: 500px">Content 2</div>
    <div>Content 2</div>
  </md-tab>
</md-tab-group>

Is it possible to remove that scrollbar (only on tab transition)?

Yes it is possible, set the dynamicHeight input to true .

<md-tab-group [dynamicHeight]="true">
  <md-tab label="Tab 1">
    <div style="height: 2000px">Content 1</div>
  </md-tab>
  <md-tab label="Tab 2">
    <div style="height: 500px">Content 2</div>
    <div>Content 2</div>
  </md-tab>
</md-tab-group>

Working PLUNKER DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM