ijlyttle / bsplus

Shiny and R Markdown addons to Bootstrap 3
http://ijlyttle.github.io/bsplus/
Other
146 stars 23 forks source link

bs_tooltip is not working with dateRangeInput/dateInput in Shiny #60

Open phileas-condemine opened 5 years ago

phileas-condemine commented 5 years ago

the package bsplus is great and easy to use but it seems it doesn't seem to handle dateRangeInput. Is that a bug ?

 Error in .tag_validate(tag, name = "div", class = "form-group shiny-input-container") : 
  class is: shiny-date-range-input form-group shiny-input-container, needs to be: form-group shiny-input-container 

It works perfectly with selectInput and most common inputs

Without tooltip it's OK, my code runs

## Only run examples in interactive R sessions
if (interactive()) {

  ui <- fluidPage(
    dateRangeInput("daterange1", "Date range:",
                   start = "2001-01-01",
                   end   = "2010-12-31")    
  )    ,
    selectInput("date", "Date:",
                   choices = c("me","you"))%>%
    shinyInput_label_embed(
      icon("question-circle") %>%
        bs_embed_tooltip(title = "choose your date range dude !")
    )

  shinyApp(ui, server = function(input, output) { })
}

with tooltip it doesn't...

## Only run examples in interactive R sessions
if (interactive()) {

  ui <- fluidPage(
    dateRangeInput("daterange1", "Date range:",
                   start = "2001-01-01",
                   end   = "2010-12-31")%>%
      shinyInput_label_embed(
        icon("question-circle") %>%
          bs_embed_tooltip(title = "choose your date range dude !")
      )    ,
    selectInput("date", "Date:",
                   choices = c("me","you"))%>%
    shinyInput_label_embed(
      icon("question-circle") %>%
        bs_embed_tooltip(title = "choose your date range dude !")
    )

  )

  shinyApp(ui, server = function(input, output) { })
}

It doesn't work with dateInput either...

https://stackoverflow.com/questions/55633392/r-bsplus-package-bs-tooltip-is-not-working-with-daterangeinput-dateinput-in-sh

micahwilhelm commented 4 years ago

Has anyone found a workaround for this bug?

ijlyttle commented 4 years ago

I think this can be fixed by making an internal validation-function a bit more lenient.