bslib icon indicating copy to clipboard operation
bslib copied to clipboard

`htmltools` in version 0.5.7 makes footer hide in `bslib`

Open gsmolinski opened this issue 1 year ago • 2 comments

Code:

library(shiny)
library(bslib)
ui <- page_navbar(
  nav_panel("One",
            card(min_height = "100vh"),
            ),
  footer = tags$p("TEST")
)

server <- function(input, output, session) {
}

shinyApp(ui, server)

Problem: Footer (with the "TEST" string) is hide by card, in the previous htmltools version, it was stick on the bottom of webpage.

Info:

R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=Polish_Poland.utf8 
[2] LC_CTYPE=Polish_Poland.utf8   
[3] LC_MONETARY=Polish_Poland.utf8
[4] LC_NUMERIC=C                  
[5] LC_TIME=Polish_Poland.utf8    

time zone: Europe/Warsaw
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

other attached packages:
[1] bslib_0.5.1   shiny_1.7.5.1

loaded via a namespace (and not attached):
 [1] digest_0.6.33   later_1.3.1    
 [3] R6_2.5.1        httpuv_1.6.12  
 [5] fastmap_1.1.1   magrittr_2.0.3 
 [7] cachem_1.0.8    memoise_2.0.1  
 [9] htmltools_0.5.7 lifecycle_1.0.4
[11] promises_1.2.1  cli_3.6.1      
[13] xtable_1.8-4    sass_0.4.7     
[15] jquerylib_0.1.4 withr_2.5.2    
[17] compiler_4.3.2  tools_4.3.2    
[19] mime_0.12       ellipsis_0.3.2 
[21] Rcpp_1.0.11     fs_1.6.3       
[23] jsonlite_1.8.7  rlang_1.1.2    

gsmolinski avatar Nov 09 '23 12:11 gsmolinski

Thanks for the report! It seems like, if we take on any changes, they'll be in bslib, so I'll be transferring there.

Also, could you elaborate a bit on why you need min_height = "100vh"? Is it to keep the card full height on mobile? In that case, I'd recommend doing page_fillable(fillable_mobile = TRUE) instead

cpsievert avatar Nov 09 '23 15:11 cpsievert

Thank you! I'm not sure I will be able to answer your question, because I have a one dashboard I made using first time bslib and everything was like "ok, I'm not sure how this works, but let's try this and this and see how it looks when I make browser smaller and bigger" (actually, not for a mobile, but for a 14-27 inch displays).

However, I have a different example when footer is hide, now without min_height, but with tabset, maybe this will be helpful:

library(shiny)
library(bslib)
ui <- page_navbar(
  nav_panel("One",
            tabsetPanel(
              tabPanel(title = "tab",
                       card(
                            card_body(
                              DT::dataTableOutput("tbl_1")
                            )
                       ),
                       card(
                            card_body(
                              DT::dataTableOutput("tbl_2")
                            )
                       )
                       )
            )
  ),
  footer = tags$p("TEST")
)

server <- function(input, output, session) {
  output$tbl_1 <- DT::renderDataTable(
    iris
    )
  
  output$tbl_2 <- DT::renderDataTable(
    iris
  )
}

shinyApp(ui, server)

gsmolinski avatar Nov 10 '23 09:11 gsmolinski