Open shahreyar-abeer opened 2 months ago
Hi @pvictor
Great package! I have encountered an issue with the airDatepickerInput(), when the 'Clear' button is clicked, the blue highlighting is not removed. (See attached .gif)
airDatepickerInput()
I have solved the issue with some JS. Here is the solution
library(shiny) library(shinyWidgets) ui <- fluidPage( tags$head( tags$script( '$(document).on("shiny:bound", function(e) { console.log(e.target.id) if (e.target.id === "multiple") { $(".air-datepicker-button span:contains(\'Clear\')").parent().on(\'click\', function() { $(".-in-range-").each(function(i, cell) {$(cell).removeClass(\'-in-range-\')}) }) } })' ) ), airDatepickerInput( inputId = "multiple", label = "Select multiple dates:", placeholder = "You can pick a range of dates", range = TRUE, clearButton = TRUE, inline = TRUE ), verbatimTextOutput("res") ) server <- function(input, output, session) { output$res <- renderPrint(input$multiple) } shinyApp(ui, server) }
Hello, Thanks for reporting the issue and for providing a solution, I'll wait to see if the javascript library is updated.
Victor
Hi @pvictor
Great package! I have encountered an issue with the
airDatepickerInput()
, when the 'Clear' button is clicked, the blue highlighting is not removed. (See attached .gif)I have solved the issue with some JS. Here is the solution