Skip to content

Commit c34fae6

Browse files
committed
fix(page-main-container): Fillable container with min-height/width only when parent layout is fillable
1 parent e1d4a50 commit c34fae6

File tree

11 files changed

+19
-15
lines changed

11 files changed

+19
-15
lines changed

scripts/_pkg-sources.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
list(
2-
bslib = "rstudio/bslib@main",
2+
bslib = "rstudio/bslib@fix/page-main-container-fillable",
33
shiny = "rstudio/shiny@main",
44
sass = "sass",
55
htmltools = "rstudio/htmltools@main"

shiny/ui/_navs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ def layout(self, nav: Tag, content: Tag) -> TagList:
13651365
# TODO-future: This could also be applied to the non-sidebar page layout above
13661366
from ._page import page_main_container
13671367

1368-
tab_content = page_main_container(*contents)
1368+
tab_content = page_main_container(*contents, fillable=self.fillable is not False)
13691369

13701370
content_div = div(
13711371
# In the fluid case, the sidebar layout should be flush (i.e.,

shiny/ui/_page.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def page_sidebar(
134134
navbar_title,
135135
layout_sidebar(
136136
sidebar,
137-
page_main_container(*children),
137+
page_main_container(*children, fillable=fillable),
138138
attrs,
139139
fillable=fillable,
140140
border=False,
@@ -149,9 +149,13 @@ def page_sidebar(
149149
)
150150

151151

152-
def page_main_container(*args: TagChild) -> Tag:
152+
def page_main_container(*args: TagChild, fillable: bool = True) -> Tag:
153153
main = tags.main({"class": "bslib-page-main bslib-gap-spacing"}, *args)
154-
return as_fillable_container(as_fill_item(main))
154+
main = as_fill_item(main)
155+
if not fillable:
156+
return main
157+
else:
158+
return as_fillable_container(main)
155159

156160

157161
@no_example()

shiny/www/shared/_version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"note!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
33
"package": "shiny",
4-
"version": "1.10.0.9000 (rstudio/shiny@531f31b66f0d83d07341b5e88e33386e4dc10f3e)"
4+
"version": "1.10.0.9000 (rstudio/shiny@f55c26af4a0493b082d2967aca6d36b90795adf1)"
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"note!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
3-
"shiny_version": "1.10.0.9000 (rstudio/shiny@531f31b66f0d83d07341b5e88e33386e4dc10f3e)",
4-
"bslib_version": "0.9.0.9000 (rstudio/bslib@ee34398b1d93056c302560512a090c1326aff7cf)",
3+
"shiny_version": "1.10.0.9000 (rstudio/shiny@f55c26af4a0493b082d2967aca6d36b90795adf1)",
4+
"bslib_version": "0.9.0.9000 (rstudio/bslib@142b19053fed81b42a4efa90c497ab2682383b86)",
55
"htmltools_version": "0.5.8.9000 (rstudio/htmltools@487aa0bed7313d7597b6edd5810e53cab0061198)",
66
"bootstrap_version": "5.3.1"
77
}

shiny/www/shared/bootstrap/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"note!": "Generated by scripts/htmlDependencies.R: do not edit by hand",
33
"package": "bslib",
4-
"version": "0.9.0.9000 (rstudio/bslib@ee34398b1d93056c302560512a090c1326aff7cf)"
4+
"version": "0.9.0.9000 (rstudio/bslib@142b19053fed81b42a4efa90c497ab2682383b86)"
55
}

shiny/www/shared/bslib/components/components.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/shared/sass/bslib/components/scss/page_sidebar.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ $bslib-sidebar-padding: $spacer * 1.5 !default;
4444
// Ensure the page-level main area has a minimum height and width to prevent
4545
// overly squished content in small screens, like IDE preview panels.
4646
.bslib-sidebar-layout {
47-
.bslib-page-main {
47+
.bslib-page-main.html-fill-container {
4848
min-height: var(--bslib-page-main-min-height, #{$bslib-page-main-min-height});
4949
}
5050

5151
// But only apply the width constraint when the sidebar expanded (i.e.
5252
// not collapsed or in transition) to prevent overlap with toggle button.
5353
&:not(.sidebar-collapsed),
5454
&.transitioning {
55-
.bslib-page-main {
55+
.bslib-page-main.html-fill-container {
5656
min-width: var(--bslib-page-main-min-width, #{$bslib-page-main-min-width});
5757
}
5858
}

shiny/www/shared/sass/preset/bootstrap/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)