From 554b26cc0192f52a382e33740c279122d2044ead Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 22 Aug 2024 11:16:13 -0400 Subject: [PATCH 1/2] fix(fill): remove ui/text outputs from document flow --- inst/fill/fill.css | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/inst/fill/fill.css b/inst/fill/fill.css index 841ea9d5..bf186811 100644 --- a/inst/fill/fill.css +++ b/inst/fill/fill.css @@ -2,14 +2,14 @@ .html-fill-container { display: flex; flex-direction: column; - /* Prevent the container from expanding vertically or horizontally beyond its - parent's constraints. */ + /* Prevent the container from expanding vertically or horizontally beyond + * its parent's constraints. */ min-height: 0; min-width: 0; } .html-fill-container > .html-fill-item { - /* Fill items can grow and shrink freely within - available vertical space in fillable container */ + /* Fill items can grow and shrink freely within available vertical space in + * fillable container */ flex: 1 1 auto; min-height: 0; min-width: 0; @@ -18,4 +18,10 @@ /* Prevent shrinking or growing of non-fill items */ flex: 0 0 auto; } + .html-fill-container > .shiny-html-output:empty, + .html-fill-container > .shiny-text-output:empty { + /* Remove empty ui and text outputs from the document flow so that extra + * space in the flex container is not allocated for them. */ + position: absolute + } } From ec4ba34818615e9bfd01a2bc0792b60621c99578 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Thu, 22 Aug 2024 11:23:30 -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 628fbaaf..2cec56de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # htmltools (development version) +* Empty Shiny text and UI outputs are now hidden by default in fillable containers. (#435) + # htmltools 0.5.8 ## Improvements