Skip to content

Commit 11ce101

Browse files
authored
fix for grid auto (#3113)
* fix for grid auto * 3.7 fix
1 parent dda2cb2 commit 11ce101

File tree

5 files changed

+228
-1
lines changed

5 files changed

+228
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
- grid-columns and grid-rows now accept an `auto` token to detect the optimal size https://github.com/Textualize/textual/pull/3107
1313

14+
### Fixed
15+
16+
- Fixed auto height container with default grid-rows https://github.com/Textualize/textual/issues/1597
17+
1418
## [0.33.0] - 2023-08-15
1519

1620
### Fixed

src/textual/layouts/grid.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def arrange(
2121
self, parent: Widget, children: list[Widget], size: Size
2222
) -> ArrangeResult:
2323
styles = parent.styles
24-
row_scalars = styles.grid_rows or [Scalar.parse("1fr")]
24+
row_scalars = styles.grid_rows or (
25+
[Scalar.parse("1fr")] if size.height else [Scalar.parse("auto")]
26+
)
2527
column_scalars = styles.grid_columns or [Scalar.parse("1fr")]
2628
gutter_horizontal = styles.grid_gutter_horizontal
2729
gutter_vertical = styles.grid_gutter_vertical

0 commit comments

Comments
 (0)