Hide the button when the multi-selection is empty with eventReactive

Split from How to tell a multiple selection is empty?

I have a similar issue: I have a selectInput control with multiple selection and ignoreNULL = FALSE, the only difference is that I use an eventReactive function. For some reason, eventReactive does not detect the change when the last element of the selectInput is removed.

Does anybody know why this happens? I would really appreciate any insight on this issue.

What you describe sounds like it should work.

I've included a small app below for you to try. If you're still having issues, please reply with the smallest app you can provide that still produces your situation.

Thank you,


ui <- fluidPage(
  selectInput("myselect", "Label", c("A", "B", "C"), multiple = TRUE)
server <- function(input, output) {
  len <- eventReactive(
    ignoreNULL = FALSE, 
    cat("Length only: ", len(), "\n", sep = "")
      "Length: ", len(), ". ",
      "Choices: ", paste0(input$myselect, collapse = ", "), 
      sep = ""
shinyApp(ui, server)