@@ -108,98 +108,92 @@ <h3>Layout Column</h3>
108
108
< br />
109
109
< hr />
110
110
111
- < h3 > Layout Column and Container Heights </ h3 >
111
+ < h3 id =" layout-column-0px-ie11 " > IE11 - Layout Column, 0px Height </ h3 >
112
112
113
113
< p >
114
- In Flexbox, some browsers will determine size of the flex containers based on the size of their
115
- content. This is particularly noticable if you have a non-flex item (say a toolbar), followed by
116
- two flex items in a column layout.
114
+ In Internet Explorer 11, when you have a column layout with unspecified height and flex items
115
+ inside, the browser can get confused and incorrectly calculate the height of each item (and thus
116
+ the container) as < code > 0px</ code > , making the items overlap and not take up the proper amount
117
+ of space.
117
118
</ p >
118
119
119
- < docs-demo demo-title ="Flex Height - Odd (Chrome ) " class ="small-demo colorNested ">
120
- < demo-file name ="index.html ">
121
- < div layout ="column " style ="height: 450px !important; ">
122
- < div style ="height: 50px; "> Toolbar</ div >
123
-
124
- < div flex layout ="column " style ="overflow: auto; ">
125
- < md-content flex layout-margin >
126
- < p > Flex with smaller content...</ p >
127
-
128
- < p ng-repeat ="i in [0,1,2,3,4] "> Line {{i}}</ p >
129
- </ md-content >
120
+ < p class ="layout_note ">
121
+ < b > Note:</ b > The flex items below actually do have some height. This is because our doc-specific
122
+ CSS provides a small bit of padding (< code > 8px</ code > ). We felt that the extra padding made for
123
+ a better demo of the actual issue.
124
+ </ p >
130
125
131
- < md-content flex layout-margin >
132
- < p >
133
- Flex with larger content...
134
- </ p >
126
+ < docs-demo demo-title ="IE11 - Layout Column, 0px Height " class ="colorNested ">
127
+ < demo-file name ="index.html ">
128
+ < div flex layout ="column ">
129
+ < div flex >
130
+ 11111< br /> 11111< br /> 11111
131
+ </ div >
135
132
136
- < p ng-repeat ="i in [0,1,2,3,4] "> Line {{i}}</ p >
133
+ < div flex >
134
+ 22222< br /> 22222< br /> 22222
135
+ </ div >
137
136
138
- < div id ="toHide ">
139
- < p ng-repeat ="i in [5,6,7,8,9] "> Line {{i}}</ p >
140
- </ div >
141
- </ md-content >
137
+ < div flex >
138
+ 33333< br /> 33333< br /> 33333
142
139
</ div >
143
140
</ div >
144
141
</ demo-file >
145
142
</ docs-demo >
146
143
147
144
< p >
148
- Notice how in Chrome the second scrollable area is nearly twice as tall as the first. This is
149
- because we are using nested flex items and the contents of the second
150
- < code > <md-content></ code > are twice as large as the first. Try clicking the button below
151
- to toggle the light blue box; this will make the containers the same size.
152
- </ p >
153
-
154
- < p layout ="row " layout-align ="center center ">
155
- < md-button class ="md-raised " ng-click ="tips.toggleContentSize() ">
156
- {{tips.toggleButtonText}} Blue Box
157
- </ md-button >
158
- </ p >
159
-
160
- < p >
161
- In order to fix this, we must specify the height of the outer flex item. The easiest way to
162
- achieve this is to simply set the height to < code > 100%</ code > . When paired with the
163
- < code > flex</ code > attribute, this achieves the desired result.
145
+ Unfortunately, there is no IE11 specific fix available, and the suggested workaround is to set
146
+ the < code > flex-basis</ code > property to < code > auto</ code > instead of < code > 0px</ code > (which is
147
+ the default setting).
164
148
</ p >
165
149
166
150
< p >
167
- < em >
168
- < strong > Note:</ strong > When < code > height: 100%</ code > is used without the < code > flex</ code >
169
- attribute, the container will take up as much space as available and squish the toolbar which
170
- has been set to a height of < code > 50px</ code > .
171
- </ em >
151
+ You can easily achieve this using the < code > flex="auto"</ code > attribute that the Layout system
152
+ provides.
172
153
</ p >
173
154
174
- < docs-demo demo-title ="Chrome Flex Height - Fixed " class ="small-demo colorNested ">
155
+ < docs-demo demo-title ="IE11 - Layout Column, 0px Height (Fix 1) " class ="colorNested ">
175
156
< demo-file name ="index.html ">
176
- < div layout ="column " style ="height: 450px !important; ">
177
- < div style ="height: 50px; "> Toolbar</ div >
157
+ < div flex layout ="column ">
158
+ < div flex ="auto ">
159
+ 11111< br /> 11111< br /> 11111
160
+ </ div >
178
161
179
- < div flex layout =" column " style =" overflow: auto; height: 100%; ">
180
- < md-content flex layout-margin >
181
- < p > Flex with smaller content... </ p >
162
+ < div flex =" auto ">
163
+ 22222 < br /> 22222 < br /> 22222
164
+ </ div >
182
165
183
- < p ng-repeat ="i in [0,1,2,3,4] "> Line {{i}}</ p >
184
- </ md-content >
166
+ < div flex ="auto ">
167
+ 33333< br /> 33333< br /> 33333
168
+ </ div >
169
+ </ div >
170
+ </ demo-file >
171
+ </ docs-demo >
185
172
186
- < md-content flex layout-margin >
187
- < p >
188
- Flex with larger content...
189
- </ p >
190
173
191
- < p ng-repeat ="i in [0,1,2,3,4] "> Line {{i}}</ p >
174
+ < p >
175
+ Alternatively, you can manually set the height of the layout container (< code > 400px</ code >
176
+ in the demo below).
177
+ </ p >
192
178
193
- < div >
194
- < p ng-repeat ="i in [5,6,7,8,9] "> Line {{i}}</ p >
195
- </ div >
196
- </ md-content >
179
+ < docs-demo demo-title ="IE11 - Layout Column, 0px Height (Fix 2) " class ="colorNested ">
180
+ < demo-file name ="index.html ">
181
+ < div flex layout ="column " style ="height: 400px; ">
182
+ < div flex >
183
+ 11111< br /> 11111< br /> 11111
184
+ </ div >
185
+
186
+ < div flex >
187
+ 22222< br /> 22222< br /> 22222
188
+ </ div >
189
+
190
+ < div flex >
191
+ 33333< br /> 33333< br /> 33333
197
192
</ div >
198
193
</ div >
199
194
</ demo-file >
200
195
</ docs-demo >
201
196
202
-
203
197
< br />
204
198
< hr />
205
199
0 commit comments