Repository: rstudio/shiny

Issue #3125: 'selectize-plugin-a11y' is causing 'updateSelectInput()' to break when using a DT with `filter` option
Created: 2020-10-31T08:18:54Z
Sample code to reproduce using latest dev version of shiny:
library(shiny)

ui <- fluidPage(
  selectInput("test", "test", choices = LETTERS[1:5]),
  actionButton("go", "go"),
  DT::DTOutput("table")
)

server <- function(input, output, session) {
  observeEvent(input$go, {
    updateSelectInput(session, "test", choices = letters[6:10])
  })

  output$table <- DT::renderDT({
    DT::datatable(mtcars, filter = "top")
  })
}

shinyApp(ui, server)

When you click "go" to update the selectInput, it become a plain HTML selectbox (see screenshot below) and a JS error in the console comes up:

VM35:2 Uncaught Error: Unable to find "selectize-plugin-a11y" plugin
    at L.a.loadPlugin (<anonymous>:2:4581)
    at L.a.require (<anonymous>:2:4888)
    at L.a.initializePlugins (<anonymous>:2:4450)
    at new L (<anonymous>:2:10781)
    at HTMLSelectElement.<anonymous> (<anonymous>:3:5531)
    at Function.each (jquery.min.js:2)
    at S.fn.init.each (jquery.min.js:2)
    at S.fn.init.a.fn.selectize (<anonymous>:3:5249)
    at exports.InputBinding._selectize (input_binding_select.js:199)
    at exports.InputBinding.receiveMessage (input_binding_select.js:62)

Notes:

The problem does not happen if the filter argument of DT is not used. It's possible that other javascript libraries would also break the new selectInput due to similar issues.
The problem does not exist in the current CRAN version 1.5.0

Duplicate issue #3339: Shiny action button doesn't work inside modal dialog when filtering is enabled in DT::datatable
Created: 2021-03-19T00:04:00Z
In the example below, a table is displayed and the user clicks a button to open a modal dialog containing an input and an action button. When filtering is enabled in the table by setting filter = "top" in DT::datatable(), the action button in the modal dialog does not respond to clicks. If filter = "none" or if the table is hidden, the same action button does respond to clicks. Interestingly, if there is no input in the modal dialog, only the action button, the action button does respond to clicks.
Run the code below as-is to see the issue (submit button inside the modal dialog doesn't trigger a response). To make the submit button work as expected, you can do one of three things:

comment out the output$myTable section and fluidRow(DTOutput("myTable"))
set filter = "none" in DT::datatable().
comment out the line selectInput("input1", ...)

I'm using DT version 0.17, Shiny version 1.6.0, and R version 4.0.4.
Update: With Shiny 1.5.0, the action button inside the modal dialog responded to clicks as expected. So it seems to be an issue with going from Shiny 1.5.0 to 1.6.0.
require(shiny)
require(DT)

shinyApp(
  ui = fluidPage(
    fluidRow(actionButton("myButton", label = "Click")),
    fluidRow(DTOutput("myTable"))
  ),
  server = function(input, output) {
    output$myTable <- renderDataTable({
      DT::datatable(
        data = mtcars[1:5, ],
        filter = "top"
      )
    })
    observeEvent(input$myButton, {
      showModal(modalDialog(
        selectInput("input1", label = "Input 1", choices = c("Ford F150", "Porsche 911")),
        actionButton("submit", label = "Submit")
      ))
    })    
    observeEvent(input$submit, {
      showModal(modalDialog(
        title = "Thank you",
        "You have clicked Submit."
      ))
    })    
  }
)

Closing comment (2021-05-25T22:35:32Z): Looks like a duplicate of #3125