@@ -76,16 +76,23 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
76
76
lines = FlexUtil . CalculateChildrenRectangles ( layoutContextRectangle , this ) ;
77
77
IList < UnitValue > previousWidths = new List < UnitValue > ( ) ;
78
78
IList < UnitValue > previousHeights = new List < UnitValue > ( ) ;
79
+ IList < UnitValue > previousMinHeights = new List < UnitValue > ( ) ;
79
80
foreach ( IList < FlexItemInfo > line in lines ) {
80
81
foreach ( FlexItemInfo itemInfo in line ) {
81
82
Rectangle rectangleWithoutBordersMarginsPaddings = itemInfo . GetRenderer ( ) . ApplyMarginsBordersPaddings ( itemInfo
82
83
. GetRectangle ( ) . Clone ( ) , false ) ;
83
84
previousWidths . Add ( itemInfo . GetRenderer ( ) . GetProperty < UnitValue > ( Property . WIDTH ) ) ;
84
85
previousHeights . Add ( itemInfo . GetRenderer ( ) . GetProperty < UnitValue > ( Property . HEIGHT ) ) ;
86
+ previousMinHeights . Add ( itemInfo . GetRenderer ( ) . GetProperty < UnitValue > ( Property . MIN_HEIGHT ) ) ;
85
87
itemInfo . GetRenderer ( ) . SetProperty ( Property . WIDTH , UnitValue . CreatePointValue ( rectangleWithoutBordersMarginsPaddings
86
88
. GetWidth ( ) ) ) ;
87
89
itemInfo . GetRenderer ( ) . SetProperty ( Property . HEIGHT , UnitValue . CreatePointValue ( rectangleWithoutBordersMarginsPaddings
88
90
. GetHeight ( ) ) ) ;
91
+ // TODO DEVSIX-1895 Once the ticket is closed, there will be no need in setting min-height
92
+ // In case element takes less vertical space than expected, we need to make sure
93
+ // it is extended to the height predicted by the algo
94
+ itemInfo . GetRenderer ( ) . SetProperty ( Property . MIN_HEIGHT , UnitValue . CreatePointValue ( rectangleWithoutBordersMarginsPaddings
95
+ . GetHeight ( ) ) ) ;
89
96
}
90
97
}
91
98
LayoutResult result = base . Layout ( layoutContext ) ;
@@ -97,6 +104,7 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
97
104
foreach ( FlexItemInfo itemInfo in line ) {
98
105
itemInfo . GetRenderer ( ) . SetProperty ( Property . WIDTH , previousWidths [ counter ] ) ;
99
106
itemInfo . GetRenderer ( ) . SetProperty ( Property . HEIGHT , previousHeights [ counter ] ) ;
107
+ itemInfo . GetRenderer ( ) . SetProperty ( Property . MIN_HEIGHT , previousMinHeights [ counter ] ) ;
100
108
++ counter ;
101
109
}
102
110
}
0 commit comments