Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateAirDateInput does not fully overwrite disabledDates #700

Open
ZIBOWANGKANGYU opened this issue Jul 12, 2024 · 2 comments
Open

updateAirDateInput does not fully overwrite disabledDates #700

ZIBOWANGKANGYU opened this issue Jul 12, 2024 · 2 comments

Comments

@ZIBOWANGKANGYU
Copy link

When using updateAirDateInput to update disabledDates for multiple times, new updates do not fully overwrite old updates. Instead, if a date has been disabled by an old call to updateAirDateInput, it will stay disabled even if it is not included in the disabledDates in a new call to updateAirDateInput.

Repex:

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  airDatepickerInput("date_input", "Pick a date"),

  actionButton("disable_date", "Disable date")
)

# Define server logic required to draw a histogram
server <- function(input, output, session) {
  click_count <- reactiveVal(0)
  observeEvent(input$disable_date, {
    updateAirDateInput(inputId = "date_input", options = list(
      disabledDates = (Sys.Date() + click_count()) # After each time clicking "disable_date", only one date should be disabled. The previously disabled date should be enabled again. But this is not the case. Previously disabled dates remain enabled. 
    ))
    click_count(click_count() + 1)
  })
}

# Run the application 
shinyApp(ui = ui, server = server)
@pvictor
Copy link
Member

pvictor commented Aug 28, 2024

Hello,
Thanks for reporting, should be fixed if you re-install from GitHub.

Victor

@ZIBOWANGKANGYU
Copy link
Author

Can confirm that problem has been fixed in v0.8.6.9100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants