The following example code below does not trigger any feedbackWarning() messages when the search query is submitted, regardless of the validation status of the query string. However, the same code works as expected after swapping searchInput() for textInput().
Software:
R version 4.5.3 (2026-03-11)
> packageVersion("shiny"); packageVersion("shinyWidgets"); packageVersion("shinyFeedback")
[1] ‘1.13.0’
[1] ‘0.9.1’
[1] ‘0.4.0’
library(shiny)
library(shinyWidgets)
library(shinyFeedback)
ui <- fluidPage(
useShinyFeedback(),
searchInput("mysearch", "Search:",
btnSearch = icon("magnifying-glass"), btnReset = icon("xmark")),
textOutput("mytext")
)
server <- function(input, output, session) {
observeEvent(input$mysearch, {
# Check condition: if search is empty
warn <- nchar(input$mysearch) < 3 && nchar(input$mysearch) > 0
feedbackWarning(
inputId = "mysearch",
show = warn,
text = "Must be at least 3 characters"
)
})
output$mytext <- renderText("Search results (dummy)")
}
shinyApp(ui, server)
The following example code below does not trigger any feedbackWarning() messages when the search query is submitted, regardless of the validation status of the query string. However, the same code works as expected after swapping searchInput() for textInput().
Software:
R version 4.5.3 (2026-03-11)