Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input values with event priority aren't logged on every event #239

Closed
cpsievert opened this issue Jan 25, 2019 · 1 comment
Closed

Input values with event priority aren't logged on every event #239

cpsievert opened this issue Jan 25, 2019 · 1 comment
Assignees

Comments

@cpsievert
Copy link
Contributor

cpsievert commented Jan 25, 2019

In the following app, the input$key is set on the client with event priority. As a result, the reactive value i gets bumped on every button press. Currently, recordTest() doesn't generate a setInput() call on every button press, meaning it's impossible to record tests for an app like this:

library(shiny)

ui <- fluidPage(
  tags$button("Input no binding", onclick = "Shiny.setInputValue('key', 'value', {priority: 'event'})"),
  textOutput("n")
)

server <- function(input, output, session) {
  
  i <- reactiveVal(0)
  
  observeEvent(input$key, {
    i(i() + 1)
  })
  
  output$n <- renderText({
    i()
  })
  
}

shinyApp(ui, server)
@cpsievert
Copy link
Contributor Author

Closed via 315f064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant