title: R Shiny stop code execution until modal is closed
body: <p>I want to execute rest of  shiny app code only when modal dialog box is closed. How can I achieve this?</p>
  
  <p>Here simple code:</p>
  
  <pre><code># ui.R
  actionButton("loadData", label = "Button", icon = icon("mail-forward"))
  
  # server.R
  observeEvent(input$loadData, {
  
    showModal(modalDialog(
      title = modal.title,
      textInput("newName", "Enter file name:", value = ""),
      easyClose = TRUE,
      footer = list(
        actionButton("confirmName", "OK"),
        modalButton("Cancel"))
    ))
  
    # ...code to be executed after modal is closed...
  
  })
  </code></pre>