Skip to content

Commit f4cfbc8

Browse files
authored
Merge pull request #4844 from Textualize/auto-grow
grow height for scrollbar
2 parents 5472c18 + 2fc524a commit f4cfbc8

File tree

6 files changed

+299
-96
lines changed

6 files changed

+299
-96
lines changed

CHANGELOG.md

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

1212
- Input cursor will no longer jump to the end on focus https://github.com/Textualize/textual/pull/4773
1313
- Removed `Size.cip_size`, which was a clone of `crop_size`
14+
- Widgets with auto dimensions will now grow if there is a scrollbar https://github.com/Textualize/textual/pull/4844
1415

1516
### Fixed
1617

src/textual/widget.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,9 @@ def _get_box_model(
12361236
content_width = Fraction(
12371237
self.get_content_width(content_container - margin.totals, viewport)
12381238
)
1239-
if styles.scrollbar_gutter == "stable" and styles.overflow_x == "auto":
1239+
if (
1240+
styles.overflow_x == "auto" and styles.scrollbar_gutter == "stable"
1241+
) or self.show_vertical_scrollbar:
12401242
content_width += styles.scrollbar_size_vertical
12411243
if (
12421244
content_width < content_container.width
@@ -1286,7 +1288,9 @@ def _get_box_model(
12861288
content_height = Fraction(
12871289
self.get_content_height(content_container, viewport, int(content_width))
12881290
)
1289-
if styles.scrollbar_gutter == "stable" and styles.overflow_y == "auto":
1291+
if (
1292+
styles.overflow_y == "auto" and styles.scrollbar_gutter == "stable"
1293+
) or self.show_horizontal_scrollbar:
12901294
content_height += styles.scrollbar_size_horizontal
12911295
if (
12921296
content_height < content_container.height
Lines changed: 155 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)