Skip to content

Commit c469081

Browse files
robertmesserlejelbourn
authored andcommitted
fix(tab-group): height will stretch for content or scroll if needed (#497)
1 parent e8cf256 commit c469081

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/components/tab-group/tab-group.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
@import 'default-theme';
33

44
$md-tab-bar-height: 48px !default;
5+
$md-tab-content-min-height: 200px !default;
56

67
:host {
7-
display: block;
8+
display: flex;
9+
flex-direction: column;
810
font-family: $md-font-family;
11+
min-height: $md-tab-bar-height + $md-tab-content-min-height;
912
}
1013

1114
/** The top section of the view; contains the tab labels */
@@ -15,6 +18,7 @@ $md-tab-bar-height: 48px !default;
1518
display: flex;
1619
flex-direction: row;
1720
border-bottom: 1px solid md-color($md-background, status-bar);
21+
flex-shrink: 0;
1822
}
1923

2024
/** Wraps each tab label */
@@ -41,14 +45,18 @@ $md-tab-bar-height: 48px !default;
4145
/** The bottom section of the view; contains the tab bodies */
4246
.md-tab-body-wrapper {
4347
position: relative;
44-
height: 200px;
4548
overflow: hidden;
46-
padding: 12px;
49+
flex-grow: 1;
50+
display: flex;
4751
}
4852

4953
/** Wraps each tab body */
5054
.md-tab-body {
5155
display: none;
56+
overflow: auto;
57+
box-sizing: border-box;
58+
flex-grow: 1;
59+
flex-shrink: 1;
5260
&.md-active {
5361
display: block;
5462
}

src/demo-app/tab-group/tab-group-demo.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33
.md-tab-header {
44
background: #f9f9f9;
55
}
6+
.md-tab-body {
7+
padding: 12px;
8+
}
69
}

0 commit comments

Comments
 (0)