title: Have downloadButton work with observeEvent
body: <p>I want to add functionality that gives the user feedback once they click <code>downloadButton</code> in my shiny app (e.g., it gives the user an alert message or toggles ui elements once clicked). Essentially, I want to be able to have <code>downloadButton</code> download some data <strong>and</strong> behave like <code>actionButton</code>, so that it responds to event triggers. Is this possible? This is how I have my code set up:</p>
  
  <pre><code>ui &lt;- fluidPage(
    useShinyjs(),
  
    downloadButton("download", "Download some data")
  )
  
  server &lt;- function(input, output, session) {
  
    observeEvent(input$download, {  # supposed to alert user when button is clicked
      shinyjs::alert("File downloaded!")  # this doesn't work
    })
  
    output$download &lt;- downloadHandler(  # downloads data
      filename = function() {
        paste(input$dataset, ".csv", sep = "")
      },
      content = function(file) {
        write.csv(mtcars, file, row.names = FALSE)
      }
    )
  
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>This only seems to work if I change <code>downloadButton</code> to an <code>actionButton</code> element in the ui, but doing this disables the download output.</p>