I am trying to implement feedback for users of my app using shinyFeedback
. I use custom currency formatting of numeric inputs from shinyWidgets
. These two do not seem to work together. Below is a reprex showing shinyFeedback
working correctly with numericInput
, but not working with autonumericInput
.
Is there any trick to make these two work together?
library(shiny)
library(shinyWidgets)
library(shinyFeedback)
ui <- fluidPage(
useShinyFeedback(),
numericInput(
"numeric_input", "numeric_input",
value = 1e6, min = -Inf, max = Inf
),
autonumericInput(
"autonumeric_input", "autonumeric_input",
value = 1e6, currencySymbol = "€", currencySymbolPlacement = "p", decimalPlaces = 0, digitGroupSeparator = " "
),
)
server <- function(input, output, session) {
observeEvent(input$numeric_input, {
feedbackWarning("numeric_input", show = input$numeric_input >= 0, text = "Hello numeric_input")
})
observeEvent(input$autonumeric_input, {
feedbackWarning("autonumeric_input", show = input$autonumeric_input >= 0, text = "Hello autonumeric_input")
})
}
shinyApp(ui, server)
This may be a workaround to solve this sort of problem.