Closed danmalter closed 10 months ago
The argument does work, I verified it when it was implemented, and again now. You must not have the latest version installed, or have something strange going on with your R library. I'm closing this issue as there is no reprex and no sufficient info.
If you believe there is a bug, please send a minimal reprex and your session info.
I want to add that I'm experiences the same thing. I've done a few uninstall/reinstall shinycssloaders and am using renv to manage my packages. My renv.lock file shows this...
"shinycssloaders": {
"Package": "shinycssloaders",
"Version": "1.0.0",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"digest",
"glue",
"grDevices",
"shiny"
],
But every time I start my app, I get this warning.
Warning: Error in withSpinner: unused argument (caption = "Loading...")
83: rlang::list2
82: card
77: overview$ui [app\view\overview.R#11]
62: shiny_module$ui [app\main.R#32]
61: _fn [/R/cache/R/renv/cache/v5/R-4.3/x86_64-w64-mingw32/rhino/1.5.0/aec1b2db96151d32a244d38b136d8392/rhino/as_top_level.R#6]
60: ui
1: runApp
I also tried it in a blank slate R session, not associated with any renv or rhino projects. I used the example from the README and added a caption set to "Loading..."
library(shiny)
ui <- fluidPage(
actionButton("go", "Go"),
shinycssloaders::withSpinner(
plotOutput("plot"),
caption = "Loading..."
)
)
server <- function(input, output) {
output$plot <- renderPlot({
input$go
Sys.sleep(1.5)
plot(runif(10))
})
}
shinyApp(ui, server)
It worked without caption = "Loading...", but as soon as I ran it again with a caption, this was the trace I got back.
Error in shinycssloaders::withSpinner(plotOutput("plot"), caption = "Loading...") :
unused argument (caption = "Loading...")
5. dots_list(...)
4. div(class = "container-fluid", ...)
3. list2(...)
2. bootstrapPage(div(class = "container-fluid", ...), title = title, theme = theme, lang = lang)
1. fluidPage(actionButton("go", "Go"), shinycssloaders::withSpinner(plotOutput("plot"), caption = "Loading..."))
You're experiencing this issue because you are using the CRAN version. This feature is not on CRAN, it's in the latest development version.
remotes::install_github("daattali/shinycssloaders")
I have loaded 1.0.0.9011, but am getting an unused argument error with the caption parameter inside of withSpinner(). Have you verified that the caption parameter works on your end?