After assigning a non-integer value to a numericInput I start getting a hint that the nearest valid values are integers. This is incorrect, and misleading to users, but I can see no way to suppress the hint. What am I missing?
Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.
For shiny question, here are some advice on Shiny debugging and reprex guide
Hover the cursor over the numericInput to get the spurious message. It looks like step defaults to 1 and only step increments from 0 are considered 'valid' even though the value of the numericInput can be used quite OK.
shinyApp(
ui = fluidPage(
numericInput("test", "test", 1),
verbatimTextOutput("testvalue")
),
server = function(input, output, session) {
updateNumericInput(session, "test", value = 1.1)
output$testvalue <- renderText({paste0("test value ", input$test)})
}
)
I think you need to specify the accepted step for your numeric input. If you change the step
argument, you have no message
library(shiny)
shinyApp(
ui = fluidPage(
numericInput("test", "test", 1, step = 0.1),
verbatimTextOutput("testvalue")
),
server = function(input, output, session) {
updateNumericInput(session, "test", value = 1.1)
output$testvalue <- renderText({paste0("test value ", input$test)})
}
)
Implying that numericInput should only be used with discrete inputs with corresponding step size. Small step size has undesirable effects on performance e.g. when user has to scroll through many steps causing invalidation and recalculation each time. No doubt I could expend a few hours working around this feature.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.