You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the footer option in page_navbar() with a fillable layout, the footer does not adjust to the changing page size. Instead, it just stays under the UI elements in the location where the bottom of the initial page was.
If you use the fillable = FALSE argument, then the footer is always present right below your last UI element, instead of at the bottom of the page. However, it does stay below all elements, and does adjust as new elements are added.
I coded this up on the shinylive website so that people could play with the fillable = TRUE or fillable = FALSE options and could see the behavior of the footer text.
I just repeated the example text to create a very large UI as the example.
Here is the code that is also shown on the shinylive site.
library(shiny)
library(bslib)
ui<- page_navbar( #<<
nav_panel("A", tagList("Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content",
br(), "Page A content")), #<<
nav_panel("B", "Page B content"), #<<
nav_panel("C", "Page C content"), #<<title="App with navbar", #<<id="page",
footer="my footer",
fillable=TRUE#<<
) #<<server<-function(input, output) {
}
shinyApp(ui=ui, server=server)
Thanks for the issue @SokolovAnatoliy. I do think we should take a look at this to see if we can make things a bit more automatic, but here's a relatively simple solution: wrap the contents of Tab A in a div() with class = "overflow-auto". This causes the content in that tab to scroll rather than to overflow underneath the page footer.
library(shiny)
library(bslib)
ui<- page_navbar(
nav_panel("A", div("Page A content", lorem::ipsum(20)), class="overflow-auto"),
nav_panel("B", "Page B content"),
nav_panel("C", "Page C content"),
title="App with navbar",
id="page",
footer="my footer",
fillable=TRUE
)
server<-function(input, output) {
}
shinyApp(ui=ui, server=server)
Describe the problem
When using the footer option in page_navbar() with a fillable layout, the footer does not adjust to the changing page size. Instead, it just stays under the UI elements in the location where the bottom of the initial page was.
If you use the fillable = FALSE argument, then the footer is always present right below your last UI element, instead of at the bottom of the page. However, it does stay below all elements, and does adjust as new elements are added.
I coded this up on the shinylive website so that people could play with the fillable = TRUE or fillable = FALSE options and could see the behavior of the footer text.
I just repeated the example text to create a very large UI as the example.
Here is the code that is also shown on the shinylive site.
https://shinylive.io/r/editor/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKAZwAtaJWAlAB0IdJiw71OY4RBEBXWgAIAPAFolqKAHM4AfWgA3ei3ZKAxCpUilSo3q0Q41dkLABBN7iWkdAGVpOUlcwAAUdOCV3JWIyClIvG1tklNS0lKZ2AW83cN0omJJyMi8lJPSKiszssrCIgtjihLwyiEr2tOqcuvzoxvjS8o6Ortq8yL6igZah4crR3PrJuJKZtrmRxizu8Yap1Zz1jfmtmsXewpXmw+P2hZ6Jy6bBo9vO052lp+mbt-T73bLZ5rP7-D5jL79A6tUHvbYQi5Q64w2EZcHnR5Il6otHwjF7K7YnG2AGQ-bI2aw0mI8lE4nUzG0kHEpQMgnA3709EPdk-FFcvE8oF8ymgtnC6Giv7i76S16omVY5kCs5C2UU+VU7mA9V0nGKpmc-XasmE5XGwU6pVGhUmmlmm1ay2mjn8i2qq2Gt2253211St4Gh3ep0el0izViu2M4MB25B-2R6XR3lylmslMSjXphMRnOZ3Xmn1hv15lm5tPlgvWkNR30xxP5+up7NV5tZvXFz6l1YCGqWazreyOZwhABCgx5Y8L-asSWHUCcLjcAGFJ7sVzPvAOkqRaKRqJEALy1dzoJQAd333DsUGMLFKO-WtAAJkoT24tLpEusAGZEIhyEYd9ahgVglH-QC4EYH9bF-WhqGoKB6EPECABUsAAVQAUSfAQLDnOQIE4aDDGg1QNF-eQIAIPcSHYPhUHkUhvCIZimNIfCQBEEQAF8eOI3h+DPVB2EUEDFG8EjGDI4CT2k2TZDAXiAF0gA
I added the sessionInfo() from the shinylive site, for completeness.
Session Info
The text was updated successfully, but these errors were encountered: