daattali / shinyalert

🗯️ Easily create pretty popup messages (modals) in Shiny
https://daattali.com/shiny/shinyalert-demo/
Other
242 stars 26 forks source link

numericInput and shinyalert #70

Closed alipprc closed 2 years ago

alipprc commented 2 years ago

I have a problem with popups while using the numericInput in shiny :

library(shinyalert)

ui <- fluidPage(
  numericInput("obs", "Observations:", 1),
  verbatimTextOutput("value")
)
server <- function(input, output) {
  observeEvent(input$obs,{
    if(!is.na(input$obs) && input$obs >10){
      shinyalert("warning!", "input too big", type = "warning")
    }
  })
  output$value <- renderText({ input$obs })
}
shinyApp(ui, server)

let say user provide 3 digit number like 111, we get the warning, but if you want to modify the number, you keep getting the warning as long as the remaining number in bigger than 10 ! it does not allow you to finish your input !

daattali commented 2 years ago

This is not an issue with shinyalert. The behaviour is correct. Your question is a request for help with a shiny app, please use another forum (such as stackoverflow or https://community.rstudio.com/) for help since this is a general shiny question.