title: Reactive R/Shiny app "forgets" variable state after other reactive variable changes
body: <p>Below is a reproducible example. When you click in the histogram area, a textbox appears showing the location of that click. But when you move the slider in the sidepanel, the textbox disappears and you have to click the histogram again to make it re-appear. How can I ensure that once the plot is clicked, the textbox remains (and keeps the same content) until the next click occurs, even if the slider is moved?</p>
  
  <pre><code>ui &lt;- fluidPage(
  
    titlePanel("Hello Shiny!"),
  
    sidebarLayout(
  
      sidebarPanel(
  
        sliderInput(inputId = "bins",
              label = "Number of bins:",
              min = 1,
              max = 50,
              value = 30)
  
      ),
  
      mainPanel(
  
        plotOutput(outputId = "distPlot",click = "plot_click"),
        verbatimTextOutput("click_x")
      )
    )
  )
  
  # Define server logic required to draw a histogram ----
  server &lt;- function(input, output) {
  
    output$click_x &lt;- renderText({
      input$plot_click$x
    })
  
  
    output$distPlot &lt;- renderPlot({
  
      x    &lt;- faithful$waiting
      bins &lt;- seq(min(x), max(x), length.out = input$bins + 1)
  
      hist(x, breaks = bins, col = "#75AADB", border = "white",
         xlab = "Waiting time to next eruption (in mins)",
         main = "Histogram of waiting times")
  
    })
  
  }
  
  shinyApp(ui, server)
  </code></pre>