diff --git a/CHANGELOG.md b/CHANGELOG.md
index d559902246..980abbc52e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Breaking change: `Button` no longer inherits from `Static`, now it inherits directly from `Widget` https://github.com/Textualize/textual/issues/3603
- Rich markup in markdown headings is now escaped when building the TOC https://github.com/Textualize/textual/issues/3689
- Mechanics behind mouse clicks. See [this](https://github.com/Textualize/textual/pull/3495#issue-1934915047) for more details. https://github.com/Textualize/textual/pull/3495
+- Breaking change: max/min-width/height now includes padding and border. https://github.com/Textualize/textual/pull/3712
## [0.41.0] - 2023-10-31
diff --git a/src/textual/widget.py b/src/textual/widget.py
index ac5da1e04d..9031717e01 100644
--- a/src/textual/widget.py
+++ b/src/textual/widget.py
@@ -1024,7 +1024,9 @@ def _get_box_model(
min_width = styles.min_width.resolve(
content_container, viewport, width_fraction
)
- content_width = max(content_width, min_width)
+ if is_border_box:
+ min_width -= gutter.width
+ content_width = max(content_width, min_width, Fraction(0))
if styles.max_width is not None:
# Restrict to maximum width, if set
@@ -1066,13 +1068,17 @@ def _get_box_model(
min_height = styles.min_height.resolve(
content_container, viewport, height_fraction
)
- content_height = max(content_height, min_height)
+ if is_border_box:
+ min_height -= gutter.height
+ content_height = max(content_height, min_height, Fraction(0))
if styles.max_height is not None:
# Restrict maximum height, if set
max_height = styles.max_height.resolve(
content_container, viewport, height_fraction
)
+ if is_border_box:
+ max_height -= gutter.height
content_height = min(content_height, max_height)
content_height = max(Fraction(0), content_height)
diff --git a/src/textual/widgets/_input.py b/src/textual/widgets/_input.py
index fd2a24bf46..0b5dceef08 100644
--- a/src/textual/widgets/_input.py
+++ b/src/textual/widgets/_input.py
@@ -145,8 +145,7 @@ class Input(Widget, can_focus=True):
padding: 0 2;
border: tall $background;
width: 100%;
- height: 1;
- min-height: 1;
+ height: 3;
}
Input:focus {
border: tall $accent;
diff --git a/src/textual/widgets/_select.py b/src/textual/widgets/_select.py
index 92b1cb75f2..33fb70d505 100644
--- a/src/textual/widgets/_select.py
+++ b/src/textual/widgets/_select.py
@@ -206,7 +206,7 @@ class Select(Generic[SelectType], Vertical, can_focus=True):
width: 1fr;
display: none;
height: auto;
- max-height: 10;
+ max-height: 12;
overlay: screen;
constrain: y;
}
diff --git a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr
index f9abc1ed64..25ea7c838d 100644
--- a/tests/snapshot_tests/__snapshots__/test_snapshots.ambr
+++ b/tests/snapshot_tests/__snapshots__/test_snapshots.ambr
@@ -21214,6 +21214,166 @@
'''
# ---
+# name: test_missing_vertical_scroll
+ '''
+
+
+ '''
+# ---
# name: test_modal_dialog_bindings
'''