@@ -76,16 +76,23 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
7676 lines = FlexUtil . CalculateChildrenRectangles ( layoutContextRectangle , this ) ;
7777 IList < UnitValue > previousWidths = new List < UnitValue > ( ) ;
7878 IList < UnitValue > previousHeights = new List < UnitValue > ( ) ;
79+ IList < UnitValue > previousMinHeights = new List < UnitValue > ( ) ;
7980 foreach ( IList < FlexItemInfo > line in lines ) {
8081 foreach ( FlexItemInfo itemInfo in line ) {
8182 Rectangle rectangleWithoutBordersMarginsPaddings = itemInfo . GetRenderer ( ) . ApplyMarginsBordersPaddings ( itemInfo
8283 . GetRectangle ( ) . Clone ( ) , false ) ;
8384 previousWidths . Add ( itemInfo . GetRenderer ( ) . GetProperty < UnitValue > ( Property . WIDTH ) ) ;
8485 previousHeights . Add ( itemInfo . GetRenderer ( ) . GetProperty < UnitValue > ( Property . HEIGHT ) ) ;
86+ previousMinHeights . Add ( itemInfo . GetRenderer ( ) . GetProperty < UnitValue > ( Property . MIN_HEIGHT ) ) ;
8587 itemInfo . GetRenderer ( ) . SetProperty ( Property . WIDTH , UnitValue . CreatePointValue ( rectangleWithoutBordersMarginsPaddings
8688 . GetWidth ( ) ) ) ;
8789 itemInfo . GetRenderer ( ) . SetProperty ( Property . HEIGHT , UnitValue . CreatePointValue ( rectangleWithoutBordersMarginsPaddings
8890 . 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 ( ) ) ) ;
8996 }
9097 }
9198 LayoutResult result = base . Layout ( layoutContext ) ;
@@ -97,6 +104,7 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
97104 foreach ( FlexItemInfo itemInfo in line ) {
98105 itemInfo . GetRenderer ( ) . SetProperty ( Property . WIDTH , previousWidths [ counter ] ) ;
99106 itemInfo . GetRenderer ( ) . SetProperty ( Property . HEIGHT , previousHeights [ counter ] ) ;
107+ itemInfo . GetRenderer ( ) . SetProperty ( Property . MIN_HEIGHT , previousMinHeights [ counter ] ) ;
100108 ++ counter ;
101109 }
102110 }
0 commit comments