File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -261,9 +261,8 @@ def get_content_height(
261
261
child .styles .is_dynamic_height for child in widget .displayed_children
262
262
):
263
263
# An exception for containers with all dynamic height widgets
264
- arrangement = widget ._arrange (
265
- Size (width , container .height - widget .gutter .height )
266
- )
264
+ arrangement = widget ._arrange (Size (width , container .height ))
265
+ return arrangement .total_region .bottom
267
266
else :
268
267
arrangement = widget ._arrange (Size (width , 0 ))
269
268
height = arrangement .total_region .bottom
Original file line number Diff line number Diff line change @@ -1590,7 +1590,11 @@ def _get_box_model(
1590
1590
elif is_auto_height :
1591
1591
# Calculate dimensions based on content
1592
1592
content_height = Fraction (
1593
- self .get_content_height (content_container , viewport , int (content_width ))
1593
+ self .get_content_height (
1594
+ content_container - margin .totals ,
1595
+ viewport ,
1596
+ int (content_width ),
1597
+ )
1594
1598
)
1595
1599
if (
1596
1600
styles .overflow_y == "auto" and styles .scrollbar_gutter == "stable"
Original file line number Diff line number Diff line change @@ -3285,7 +3285,11 @@ def test_collapsible_datatable(snap_compare):
3285
3285
class MyApp (App ):
3286
3286
CSS = """
3287
3287
DataTable {
3288
-
3288
+
3289
+ }
3290
+ Collapsible {
3291
+ max-height: 50%;
3292
+ # height: 1fr;
3289
3293
}
3290
3294
"""
3291
3295
@@ -3294,8 +3298,8 @@ def compose(self) -> ComposeResult:
3294
3298
yield Collapsible (Label ("hello" ), id = "c2" )
3295
3299
3296
3300
def on_mount (self ) -> None :
3297
- self .query_one ("#c1" , Collapsible ).styles .max_height = "50%"
3298
- self .query_one ("#c2" , Collapsible ).styles .max_height = "50%"
3301
+ # self.query_one("#c1", Collapsible).styles.max_height = "50%"
3302
+ # self.query_one("#c2", Collapsible).styles.max_height = "50%"
3299
3303
3300
3304
t1 = self .query_one ("#t1" , DataTable )
3301
3305
t1 .styles .border = "heavy" , "black"
You can’t perform that action at this time.
0 commit comments