Skip to content

Commit dfeeeee

Browse files
m4m4m4Devin Fields
authored and
Devin Fields
committed
fix(header): Change grid header css to flexbox
* Change grid header css to flexbox Change grid header css to be flexbox based Header display properties was previously table based while body is block based. This causes alignment issues in some cases. * Better spacing * Another space Fix angular-ui#6799, Fix angular-ui#2592
1 parent 39d3ab3 commit dfeeeee

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/less/header.less

+17-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
// Clearfix for floating header cells
3434
&:before, &:after {
3535
content: "";
36-
display: table;
36+
display: -ms-flexbox;
37+
display: flex;
3738
line-height: 0;
3839
}
3940

@@ -44,15 +45,23 @@
4445
// .border-radius(@gridBorderRadius, 0, 0, @gridBorderRadius);
4546
}
4647

48+
4749
.ui-grid-header-cell-wrapper {
4850
position: relative;
49-
display: table;
51+
display: -ms-flexbox;
52+
display: flex;
5053
box-sizing: border-box;
5154
height: 100%;
55+
width: 100%;
5256
}
5357

5458
.ui-grid-header-cell-row {
55-
display: table-row;
59+
display: -ms-flexbox;
60+
display: flex;
61+
-ms-flex-direction: row;
62+
flex-direction: row;
63+
-ms-flex-wrap: wrap;
64+
flex-wrap: wrap;
5665
}
5766

5867
.ui-grid-header-cell {
@@ -61,7 +70,6 @@
6170
background-color: inherit;
6271
border-right: @gridBorderWidth solid;
6372
border-color: @headerVerticalBarColor;
64-
display: table-cell;
6573

6674
&:last-child {
6775
border-right: 0;
@@ -84,6 +92,11 @@
8492
margin-left: -8px;
8593
}
8694
}
95+
/* Fixes IE word-wrap if needed on header cells */
96+
.ui-grid-header-cell > div {
97+
-ms-flex-basis: 100%;
98+
flex-basis: 100%;
99+
}
87100

88101
// Make vertical bar in header row fill the height of the cell completely
89102
.ui-grid-header .ui-grid-vertical-bar {

0 commit comments

Comments
 (0)