Skip to content

Commit b96388a

Browse files
authored
fix(page-main-container): Fillable container with min-height/width only when parent layout is fillable (#1885)
1 parent 214dff4 commit b96388a

File tree

12 files changed

+22
-14
lines changed

12 files changed

+22
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
* The `.get_latest_stream_result()` method on `ui.MarkdownStream()` was deprecated in favor of the new `.latest_stream` property. Call `.result()` on the property to get the latest result, `.status` to check the status, and `.cancel()` to cancel the stream.
1313

14+
### Bug fixes
15+
16+
* Fixed an issue where the `<main>` areas of `ui.page_sidebar()` and `ui.page_navbar()` (with a `sidebar`) were made to be a fillable containers even when `fillable=False`. (#1816)
17+
1418
## [1.3.0] - 2025-03-03
1519

1620
### New features

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,9 @@ 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(
1369+
*contents, fillable=self.fillable is not False
1370+
)
13691371

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

shiny/ui/_page.py

Lines changed: 4 additions & 2 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,8 +149,10 @@ 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+
if not fillable:
155+
return main
154156
return as_fillable_container(as_fill_item(main))
155157

156158

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.

shiny/www/shared/bslib/_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": "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.

shiny/www/shared/sass/preset/shiny/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)