Mateus Figueiredo
Mateus Figueiredo

Reputation: 81

How to disable the numericInput message error in Shiny?

My issue is similar to this 2018 problem, and there is a working example in the link.

When you use a numericInput widget in Shiny, you can set a value and a step by which the user can change the value. I'd like to set a standard value with decimals, such as 53.66, but have the step remain 1 so the user can easily change the values just by clicking a few times.

However, when the user hovers the cursor over the widget, they get a message that says that the only valid values are numbers ending with .66. The widget works just fine with wathever values, but the message can mislead users.

Is there anyway to supress the message? Or change it?

Thanks!

Upvotes: 0

Views: 212

Answers (1)

mnist
mnist

Reputation: 6954

Sure, you can set step = "any".

Source

shinyApp(
  ui = fluidPage(
    numericInput("test", "test", 1, step = "any"),
    verbatimTextOutput("testvalue")
  ),
  server = function(input, output, session) {
    updateNumericInput(session, "test", value = 1.1)
    output$testvalue <- renderText({paste0("test value ", input$test)})
  }
)

Upvotes: 1

Related Questions