-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Bug Report: airDatepickerInput reactivity not working properly in Shiny 1.11.0
Description
The airDatepickerInput
from the shinyWidgets
package is not triggering reactive outputs properly in Shiny version 1.11.0. The reactive expressions that depend on the input are not updating when the date picker value changes.
Expected Behavior
When selecting a month using airDatepickerInput
, the reactive outputs should update immediately to reflect the new selected value.
Actual Behavior
The reactive outputs do not update when the date picker value changes. The inputs appear to be registered but do not trigger the reactive chain properly.
System Information
- Shiny version: 1.11.0 (issue present)
- Shiny version: 1.10.0 (working correctly)
- shinyWidgets version: 0.9.0
- R version: 4.3.1
Reproducible Example
library(shiny)
library(shinyWidgets)
# UI
ui <- fluidPage(
titlePanel("Shiny App with airDatePicker"),
sidebarLayout(
sidebarPanel(
h4("Select a month:"),
airDatepickerInput(
inputId = "fecha_seleccionada",
label = "Month:",
value = Sys.Date(),
view = "months",
minView = "months",
dateFormat = "MM yyyy"
)
),
mainPanel(
h4("Selected Month:"),
verbatimTextOutput("mostrar_fecha"),
br(),
h4("Additional Information:"),
textOutput("info_fecha")
)
)
)
# Server
server <- function(input, output) {
# Show the selected month
output$mostrar_fecha <- renderText({
if(!is.null(input$fecha_seleccionada)) {
paste("Month:", format(input$fecha_seleccionada, "%B %Y"))
} else {
"No month selected"
}
})
# Additional information about the month
output$info_fecha <- renderText({
if(!is.null(input$fecha_seleccionada)) {
year <- format(input$fecha_seleccionada, "%Y")
month_num <- format(input$fecha_seleccionada, "%m")
paste("Year:", year, "| Month number:", month_num)
}
})
}
# Run the application
shinyApp(ui = ui, server = server)
Steps to Reproduce
- Run the provided example code
- Select a different month using the date picker
- Observe that the text outputs do not update
Workaround
Downgrading to Shiny version 1.10.0 resolves the issue.
Additional Notes
This appears to be a regression introduced in Shiny 1.11.0. The issue specifically affects airDatepickerInput
from the shinyWidgets
package, though other input widgets from the same package may also be affected.
The input value is being captured (as evidenced by the initial render), but subsequent changes do not trigger the reactive chain properly.
