daattali/shinyjs

When disabled() a Panel, downloadbutton not affected

crosspolar opened this issue · 1 comments

When using shinyjs::disabled() with a Panel, it disables textinputs and actionbuttons like expected. However, downloadButtons get ignored and stay enabled. If you put the downloadButton solely into disabled though, it works like in originally posted by @daattali in #132 (comment).

MWE:

library(shiny)

ui <- fluidPage(
  shinyjs::useShinyjs(),
  shinyjs::disabled(
    wellPanel(
      id = "test_panel",
      downloadButton("testdw", "testdw"),
      actionButton("testab","testab"),
      textInput("testtext","testtext")
    )
    )
)

server <- function(input, output, session) {
  output$test <- downloadHandler(
    filename = "test.csv",
    content = function(con) {
      write.csv(mtcars, con)
    }
  )
}

shinyApp(ui, server)

grafik

Thanks, should be fixed now