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

Updating feedback message #55

Closed
jl5000 opened this issue Jul 25, 2021 · 1 comment
Closed

Updating feedback message #55

jl5000 opened this issue Jul 25, 2021 · 1 comment
Assignees

Comments

@jl5000
Copy link

jl5000 commented Jul 25, 2021

Hi, I'm using feedbackDanger to show a message when an input is invalid. When I change the input to another invalid value, the feedback message doesn't change even though I'm providing a different text argument. Am I using this wrong? In the below example, changing the value to 4 gives a message, but changing it to 45 doesn't update the message:

library(shiny)
library(shinyFeedback)

ui <- fluidPage(
    shinyFeedback::useShinyFeedback(),
    shiny::numericInput("number", "Input value", value = NULL, 
                        min = 0, max = 3, step = 1)

)

server <- function(input, output) {

    shiny::observeEvent(input$number, ignoreNULL = FALSE, ignoreInit = TRUE, {

        if(is.null(input$number)) {
            err <- NULL
        } else if (input$number %in% 0:3) {
            err <- NULL
        } else {
            err <- paste0(input$number, " not valid")
        }

        shinyFeedback::feedbackDanger("number", !is.null(err), err)
    })
    
}

shinyApp(ui = ui, server = server)
Shiny applications not supported in static R Markdown documents

Created on 2021-07-25 by the reprex package (v2.0.0)

@phoward38
Copy link
Collaborator

@jl5000 This issue has been resolved in the most recent development version, which can be installed with remotes::install_github('merlinoa/shinyFeedback')

@phoward38 phoward38 self-assigned this Mar 4, 2022
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

2 participants