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 update value if no options provided #690

Closed
merlinoa opened this issue Apr 17, 2024 · 2 comments
Closed

updateAirDateInput() does not update value if no options provided #690

merlinoa opened this issue Apr 17, 2024 · 2 comments

Comments

@merlinoa
Copy link

The following app does not update the value of the airDatepickerInput when the action button is clicked. The value remains blank, but if you uncomment the options = list(maxDate = Sys.Date()), then the input is updated correctly.

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  fluidRow(
    column(
      12,
      airDatepickerInput(
        "date",
        "Date"
      ),
      actionButton(
        "set_date",
        "Set Date"
      )
    )
  )
)

server <- function(input, output, session) {

  observeEvent(input$set_date, {

    updateAirDateInput(
      session,
      "date",
      value = Sys.Date(),
      #options = list(maxDate = Sys.Date())
    )

  })

}

shinyApp(ui, server)

Session info:

R version 4.3.3 (2024-02-29)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.6.8

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/New_York
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shinyWidgets_0.8.4 shiny_1.8.1.1     

loaded via a namespace (and not attached):
 [1] digest_0.6.35     later_1.3.2       R6_2.5.1          httpuv_1.6.15     fastmap_1.1.1     magrittr_2.0.3    cachem_1.0.8     
 [8] htmltools_0.5.8.1 lifecycle_1.0.4   promises_1.3.0    cli_3.6.2         xtable_1.8-4      sass_0.4.9        jquerylib_0.1.4  
[15] withr_3.0.0       compiler_4.3.3    rstudioapi_0.16.0 tools_4.3.3       bslib_0.7.0       mime_0.12         Rcpp_1.0.12      
[22] jsonlite_1.8.8    rlang_1.1.3  
@pvictor
Copy link
Member

pvictor commented Apr 17, 2024

Thanks for reporting this.
This has been corrected in the version available on GitHub. On the other hand, I've just published it on CRAN an hour ago, so we'll have to wait a bit before we can put a new version up.

@merlinoa
Copy link
Author

Great thanks! Yes, I can confirm, it is fixed in the latest version on github

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