title: R Shiny - How to display feedback message if two inputs have the same value (using shinyFeedback)
body: <p>I have two selectizeInputs (<code>state1</code> and <code>state2</code>) in my app that have the same set of choices. When the user clicks the actionButton, I would like to compare the values of <code>state1</code> and <code>state2</code> and display a feedback message to the user if they are the same. </p>
  
  <p>Both selectizeInputs are initialised with the placeholder "Search by name". If I change the value of one input for the first time and leave the value of the other unchanged at its placeholder value, then clicking the action button triggers the feedback message:</p>
  
  <p><a href="https://i.stack.imgur.com/UC2hg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UC2hg.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/cWR02.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cWR02.png" alt="enter image description here"></a></p>
  
  <p>This is puzzling to me because the message should only be displayed if <code>state1</code> and <code>state2</code> are the same. </p>
  
  <p>Here is the code to reproduce the above:</p>
  
  <pre><code>library(shiny)
  library(shinyFeedback)
  
  
  ui &lt;- fluidPage(shinyFeedback::useShinyFeedback(),
                  selectizeInput('state1', 'Select state 1', choices = state.name, 
                                 multiple = T, 
                                 options = list(placeholder = "Search by name", maxItems = 1)),
  
                  selectizeInput('state2', 'Select state 2', choices = state.name, 
                                 multiple = T, 
                                 options = list(placeholder = "Search by name", maxItems = 1)),
  
                  actionButton("click", "Click"),
  
                  textOutput("states")
  )
  
  server &lt;- function(input, output, session) {
  
    values = reactiveValues(states = NULL)
  
    observeEvent(input$click, {
  
      feedbackDanger("state1", input$state1 == input$state2, "")
  
      feedbackDanger("state2", input$state2 == input$state1, "State 1 and state 2 cannot be the same.")
  
      req(!is.null(input$state1), !is.null(input$state2), input$state1 != input$state2)
  
      values$states &lt;- paste(input$state1, input$state2)
  
    })
  
    output$states &lt;- renderText({
  
      values$states
  
    })
  }
  
  shinyApp(ui, server)
  </code></pre>
  
  <p>I think this may have something to do with using multiple = T and maxItems = 1 in the selectizeInputs or with the way I have written the trigger conditions but I don't understand why they are wrong. Any help would be greatly appreciated.</p>