@@ -380,12 +380,14 @@ impl ResizableStack {
380
380
381
381
let child = self . id . with_children ( |c| c[ handle_idx] ) ;
382
382
let offset = self . style_offsets [ handle_idx] ;
383
+ let is_last = handle_idx == self . style_offsets . len ( ) - 1 ;
383
384
child. update_style (
384
385
offset,
385
386
Style :: new ( )
386
387
. width ( new_width)
387
- . max_width ( new_width)
388
- . min_width ( 20. ) ,
388
+ . min_width ( 20. )
389
+ . apply_if ( !is_last, |s| s. max_width ( new_width) )
390
+ . apply_if ( is_last, |s| s. flex_grow ( 1. ) ) ,
389
391
) ;
390
392
391
393
// Calculate next width based on actual applied change
@@ -394,12 +396,14 @@ impl ResizableStack {
394
396
395
397
let child = self . id . with_children ( |c| c[ handle_idx + 1 ] ) ;
396
398
let offset = self . style_offsets [ handle_idx + 1 ] ;
399
+ let is_last = handle_idx + 1 == self . style_offsets . len ( ) - 1 ;
397
400
child. update_style (
398
401
offset,
399
402
Style :: new ( )
400
403
. width ( next_width)
401
- . max_width ( next_width)
402
- . min_width ( 20. ) ,
404
+ . min_width ( 20. )
405
+ . apply_if ( !is_last, |s| s. max_width ( next_width) )
406
+ . apply_if ( is_last, |s| s. flex_grow ( 1. ) ) ,
403
407
) ;
404
408
}
405
409
FlexDirection :: Column | FlexDirection :: ColumnReverse => {
@@ -425,12 +429,14 @@ impl ResizableStack {
425
429
426
430
let child = self . id . with_children ( |c| c[ handle_idx] ) ;
427
431
let offset = self . style_offsets [ handle_idx] ;
432
+ let is_last = handle_idx == self . style_offsets . len ( ) - 1 ;
428
433
child. update_style (
429
434
offset,
430
435
Style :: new ( )
431
436
. height ( new_height)
432
- . max_height ( new_height)
433
- . min_height ( 20. ) ,
437
+ . min_height ( 20. )
438
+ . apply_if ( !is_last, |s| s. max_height ( new_height) )
439
+ . apply_if ( is_last, |s| s. flex_grow ( 1. ) ) ,
434
440
) ;
435
441
436
442
// Calculate next height based on actual applied change
@@ -439,12 +445,14 @@ impl ResizableStack {
439
445
440
446
let child = self . id . with_children ( |c| c[ handle_idx + 1 ] ) ;
441
447
let offset = self . style_offsets [ handle_idx + 1 ] ;
448
+ let is_last = handle_idx + 1 == self . style_offsets . len ( ) - 1 ;
442
449
child. update_style (
443
450
offset,
444
451
Style :: new ( )
445
452
. height ( next_height)
446
- . max_height ( next_height)
447
- . min_height ( 20. ) ,
453
+ . min_height ( 20. )
454
+ . apply_if ( !is_last, |s| s. max_height ( next_height) )
455
+ . apply_if ( is_last, |s| s. flex_grow ( 1. ) ) ,
448
456
) ;
449
457
}
450
458
}
0 commit comments