Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 2bc88e2

Browse files
devversionThomasBurleson
authored andcommitted
fix(list): fix compatibility with IE11
* Added a mixin / workaround for the flexbox bug for Internet Explorer 11. * Add ng-click to first list to show hover effects. Fixes #7557. Closes #7573
1 parent 34035f0 commit 2bc88e2

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

src/components/list/demoBasicUsage/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<md-content>
1212
<md-list flex>
13-
<md-subheader class="md-no-sticky">3 line item</md-subheader>
14-
<md-list-item class="md-3-line" ng-repeat="item in todos">
13+
<md-subheader class="md-no-sticky">3 line item (with hover)</md-subheader>
14+
<md-list-item class="md-3-line" ng-repeat="item in todos" ng-click="null">
1515
<img ng-src="{{item.face}}?{{$index}}" class="md-avatar" alt="{{item.who}}" />
1616
<div class="md-list-item-text" layout="column">
1717
<h3>{{ item.who }}</h3>
@@ -83,7 +83,7 @@ <h3> {{ phone.number }} </h3>
8383
<md-content>
8484

8585
<md-list class="md-dense" flex>
86-
<md-subheader class="md-no-sticky">3 line item</md-subheader>
86+
<md-subheader class="md-no-sticky">3 line item (dense)</md-subheader>
8787
<md-list-item class="md-3-line" ng-repeat="item in todos">
8888
<img ng-src="{{item.face}}?{{$index}}" class="md-avatar" alt="{{item.who}}" />
8989
<div class="md-list-item-text" layout="column">

src/components/list/list.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ $list-item-dense-header-font-size: 1.3rem !default;
3737
$list-item-dense-font-size: 1.2rem !default;
3838
$list-item-dense-line-height: 1.25rem !default;
3939

40+
// This is a mixin, which fixes IE11's vertical alignment issue, when using `min-height`.
41+
// This mixin isn't that much generic to be used in other cases.
42+
// It can be only used for the list-item's button container.
43+
// See https://connect.microsoft.com/IE/feedback/details/816293/
44+
@mixin ie11-min-height-flexbug($min-height) {
45+
div.md-button:first-child {
46+
&::before {
47+
content: '';
48+
min-height: $min-height;
49+
visibility: hidden;
50+
}
51+
}
52+
}
53+
4054
md-list {
4155
display: block;
4256
padding: $list-padding-top $list-padding-right $list-padding-bottom $list-padding-left;
@@ -101,6 +115,8 @@ md-list {
101115
&, & > ._md-no-style {
102116
min-height: $list-item-dense-two-line-height;
103117

118+
@include ie11-min-height-flexbug($list-item-dense-two-line-height);
119+
104120
> .md-avatar, .md-avatar-icon {
105121
margin-top: $baseline-grid * 1.5;
106122
}
@@ -111,6 +127,8 @@ md-list {
111127
&, & > ._md-no-style {
112128
min-height: $list-item-dense-three-line-height;
113129

130+
@include ie11-min-height-flexbug($list-item-dense-three-line-height);
131+
114132
> md-icon:first-child,
115133
> .md-avatar {
116134
margin-top: $baseline-grid * 2;
@@ -378,6 +396,8 @@ md-list-item {
378396
height: auto;
379397
min-height: $list-item-two-line-height;
380398

399+
@include ie11-min-height-flexbug($list-item-two-line-height);
400+
381401
> .md-avatar, .md-avatar-icon {
382402
margin-top: $baseline-grid * 1.5;
383403
}
@@ -395,6 +415,8 @@ md-list-item {
395415
height: auto;
396416
min-height: $list-item-three-line-height;
397417

418+
@include ie11-min-height-flexbug($list-item-three-line-height);
419+
398420
> md-icon:first-child,
399421
> .md-avatar {
400422
margin-top: $baseline-grid * 2;

0 commit comments

Comments
 (0)