title: Shiny: revert choice on radioGroupButtons if confirmation is cancelled
body: <p>I am building a shiny app with <code>radioGroupButtons</code>. There are a few choices in this group of buttons. By default one of the choices is selected, but when a different option is selected, a confirmation will pop out. If it is confirmed, I do something, but if <code>cancel</code> is clicked in the alert, I want the selection to go back to the state before clicking the <code>radioGroupButtons</code>. </p>
  
  <p>In my code, the selection reversion will not happen until at least one time of "confirm" is clicked and it will work fine. The second problem is when it is working fine, it always triggers 2 times of the alert box. Does any one know what's wrong?</p>
  
  <pre class="lang-r prettyprint-override"><code>library(shiny)
  library(shinyWidgets)
  
  shinyApp(
      ui = fluidPage(
          tagList(
              radioGroupButtons(
                  inputId = "group_btn", label = "Choose source:", 
                  selected = "upload",
                  choiceNames = c("Upload", "Example"), 
                  choiceValues = c("upload", "eg"),
                  justified = TRUE, status = "primary",
                  checkIcon = list(yes = icon("ok", lib = "glyphicon"), no = icon(""))
              ),
              uiOutput("choice")
          )
      ),
      function(input, output, session) {
          selected_old &lt;- reactiveVal(FALSE)
          observeEvent(input$group_btn, ignoreInit = TRUE, {
              confirmSweetAlert(
                  session, inputId = "sweet_change_confirm", 
                  title = "change Source?"
                  )
              output$choice &lt;- renderUI(p(print(input$group_btn)))
          })
          observeEvent(input$sweet_change_confirm, ignoreNULL = TRUE, {
              if (isTRUE(input$sweet_change_confirm)){
                  selected_old(input$group_btn)
              } else {
                  updateRadioGroupButtons(session, "group_btn", selected = selected_old(),
                                          checkIcon = list(yes = icon("ok", lib = "glyphicon"), no = icon(""))
                                          )
              }
          })
      }
  )
  </code></pre>
  
  <p>I guess when I update the second <code>observeEvent</code>, the first <code>observeEvent</code> is triggered again because selection has been changed. If this is the case, how do I aviod? </p>