shinyFeedback
shinyFeedback copied to clipboard
Feature Request/How-To: Update message on edits
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)
}