title: Shiny modal dialog in response to multiple buttons
body: <p>Consider the following app:</p>
  
  <pre><code>ui &lt;- basicPage(
    actionButton('button1', 'click one'),
    actionButton('button2', 'click two')
  )
  server &lt;- function(input, output){
    popup &lt;- function(){
      modalDialog(easyClose = T,
                  'popup window triggered')
    }
  }
  shinyApp(ui=ui, server=server)
  </code></pre>
  
  <p>My goal is that the modal window is triggered once either of the buttons is clicked. I realise that I can create an <code>observeEvent</code> for each button, but in the full application there will be many buttons on different <code>navbar</code> pages. So in order to avoid a whole bunch of code duplication, I would like to gather them in a single <code>observeEvent</code>. I tried some of the suggestions from <a href="https://stackoverflow.com/questions/34731975/how-to-listen-for-more-than-one-event-expression-within-a-shiny-eventreactive-ha">here</a>.</p>
  
  <p>Adding</p>
  
  <pre><code> observeEvent({
      input$button1
      input$button2
      }, {
      showModal(popup())
    })
  </code></pre>
  
  <p>to <code>server()</code> doesn't really work, because for some odd reason <code>button2</code> needs to be clicked before <code>button1</code> is responsive.</p>
  
  <p>Instead, adding </p>
  
  <pre><code>  observeEvent(c(input$button1, input$button2), {
      showModal(popup())
    })
  </code></pre>
  
  <p>causes the modal window to appear on startup already, which should not happen.</p>
  
  <p>So is there a way to capture multiple action buttons into a single observe event without these undesirable behaviours?</p>