From 08a8a30ce903c6bd555a9cbe48a9e9b4638b3c32 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Thu, 8 Oct 2026 00:03:49 -0400 Subject: [PATCH] Measure stream height at the assigned content width --- src/textual/layouts/stream.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/textual/layouts/stream.py b/src/textual/layouts/stream.py index 49ac14e515..e70b4a253a 100644 --- a/src/textual/layouts/stream.py +++ b/src/textual/layouts/stream.py @@ -85,10 +85,13 @@ def arrange( margin = styles.margin gutter_width, gutter_height = styles.gutter.totals top, right, bottom, left = margin + child_width = width - (left + right) y += top if top > previous_margin else previous_margin previous_margin = bottom height = ( - widget.get_content_height(size, viewport, width - gutter_width) + widget.get_content_height( + size, viewport, max(0, child_width - gutter_width) + ) + gutter_height ) if (max_height := styles.max_height) is not None and max_height.is_cells: @@ -105,7 +108,7 @@ def arrange( ) placements.append( _WidgetPlacement( - _Region(left, y, width - (left + right), height), + _Region(left, y, child_width, height), null_offset, margin, widget,