From 90a89f90b0b83d24733703810a71a0bd52a2258c Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 1 Aug 2023 14:58:20 -0400 Subject: [PATCH 1/2] feat(fillability): Don't allow shrinking of non-fill items in fillable containers --- inst/fill/fill.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inst/fill/fill.css b/inst/fill/fill.css index 52ca6605..4c2711ec 100644 --- a/inst/fill/fill.css +++ b/inst/fill/fill.css @@ -6,10 +6,16 @@ min-height: 0; } .html-fill-container > .html-fill-item { + /* Fill items can grow and shrink freely within + available vertical space in fillable container */ flex: 1 1 auto; overflow: auto; width: 100%; } +.html-fill-container > :not(.html-fill-item) { + /* Prevent shrinking or growing of non-fill items */ + flex: 0 0 auto; +} .html-fill-container > .html-fill-item.html-fill-item-overflow-hidden { overflow: hidden; } From a317b04178cafcf178d9f170dfae2a0b28f579e0 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 1 Aug 2023 16:21:38 -0400 Subject: [PATCH 2/2] docs: Add news item --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index b88ce51f..49a62b53 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,8 @@ * Closed #386: Fillable containers no longer set `overflow: auto` by default. Instead, they set `min-width` and `min-height` to `0` to ensure that fill items a constrained in the fillable container without clipping their direct children. (#387) +* Closed #370: Non-fill items in fillable containers no longer grow or shrink and instead respect their intrinsic size. Use `height` to control the height of non-fill items in fillable containers and `min-height` and `max-height` on fill items to limit how much they are allowed to grow or shrink within a fillable container. (#391) + # htmltools 0.5.5 ## Bug fixes