bslib
bslib copied to clipboard
`input_task_button()`: Allow updating the labels and icons
I'm trying to update the label of a input_task_button and I get this error:
Error in bslib::update_task_button("go", label = "bar") :
`...` must be empty.
✖ Problematic argument:
• label = "bar"
Here's the example:
library(shiny)
ui <- fluidPage(
bslib::input_task_button("go", "foo")
)
server <- function(input, output, session) {
bslib::update_task_button("go", label = "bar")
}
shinyApp(ui, server)
Thanks @daattali. I've opened a PR to update the docs for input_task_button(). The model in this function is a bit different in that it is designed to work with a set of initially-defined task states, which is also an advanced use case that we hadn't fully documented until #1230.
That PR at least documents the current behavior and includes some text explaining that the ... are expected to be empty in update_task_button().
I'll rename this issue and leave it open as a feature request for being able to update the icons and labels