bs4Dash icon indicating copy to clipboard operation
bs4Dash copied to clipboard

Shiny 1.12.0 leads to double icons and labels in bs4Dash::actionButton() when using updateActionButton()

Open splendiduser opened this issue 3 weeks ago • 0 comments

Please see the result of this app when pressing the primary action button:

library(shiny)
library(bs4Dash)

ui <- fluidPage(
  h3("Icon Toggle Module Example"),
  bs4Dash::actionButton(
    "icon_btn_1",
    label = "bs4Dash Button",
    icon = icon("play")
  ),
  shiny::actionButton(
    "icon_btn_2",
    label = "shiny Button",
    icon = icon("play")
  ),
  actionButton(
    "toggle_btn",
    label = "Toggle Icon and Label",
    class = "btn-primary"
  )
)

server <- function(input, output, session) {
  state <- reactiveVal("play")
  
  observeEvent(input$toggle_btn, {
    new_state <- if (state() == "play") "pause" else "play"
    state(new_state)
    
    updateActionButton(
      session,
      "icon_btn_1",
      icon = icon(new_state),
      label = "new label"
    )
    
    updateActionButton(
      session,
      "icon_btn_2",
      icon = icon(new_state),
      label = "new label"
    )
  })
}

shinyApp(ui, server)

EDIT: Simplified version of the app. I forgot to remove the unnecessary module logic.

splendiduser avatar Dec 09 '25 10:12 splendiduser