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

Feature Request/How-To: Update message on edits #72

Open
asadow opened this issue Jun 21, 2024 · 0 comments
Open

Feature Request/How-To: Update message on edits #72

asadow opened this issue Jun 21, 2024 · 0 comments

Comments

@asadow
Copy link

asadow commented Jun 21, 2024

The message below will not update if say 6,8 is chosen, and then 6 is changed to 4.

library(shinyFeedback)
## Only run examples in interacive R sessions
if (interactive()) {
  ui <- fluidPage(
    useShinyFeedback(),
    
    selectInput(
      "exampleInput",
      "cyl",
      choices = mtcars$cyl |> unique(),
      multiple = TRUE
    )
  )
  
  server <- function(input, output) {
    observeEvent(input$exampleInput, {
      
      if (8 %in% input$exampleInput) {
        
        showFeedback(
          "exampleInput",
          text = paste0(input$exampleInput, collapse = ","),
          color = "#d9534f",
          icon = shiny::icon("exclamation-sign", lib="glyphicon")
        )
      } else {
        hideFeedback("exampleInput")
      }
      
    })
  }
  
  shinyApp(ui, server)
}
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