Skip to content

jquery-ui 1.11.4 datepicker has bad interaction with bootstrap datepicker #1346

Closed

Description

@dvetal

We have an app where we are trying to include both a dateRangeInput selector and a ggvisOutput for a graph in the same page. This seems to not work at this time. The underlying cause for this is that there seems to be a bad interaction between jquery-ui's datepicker and the bootstrap datepicker. Below is a minimal example for how to reproduce the problem. As I've not really spent a lot of time in front-end dev I'm just not sure I'm equipped to fix this (yet).

WHAT IS EXPECTED:
Both the date range picker and the ggvis plot should be able to be displayed on the same page with data filled in.

HOW TO REPRODUCE:
server.R file:

shinyServer( function(input, output) 
{
  mtcars_reactive <- reactive({ mtcars })
  mtcars_reactive %>% ggvis(~wt, ~mpg) %>% layer_points() %>% bind_shiny("plot")
}

ui.R file:

shinyUI(fluidPage(
dateRangeInput('dateRange', label = 'Date range: ', start = '2016-08-15', end = '2016-08-25', max = '2016-08-26'),
ggvisOutput('plot')
)
)

The effect should be that no data will load in the data range picker and the plot will not show up. If you remove either component from the ui.R file the remaining component will show up as expected.

Inspecting the DevTools in Chrome I can confirm both jquery-ui's datepicker and bootstrap datepicker are being loaded in this scenario. Another note is that this app previously worked before 0.13.2

Activity

  1. dvetal commented on Sep 1, 2016

    @dvetal
    Author
  2. wch commented on Sep 1, 2016

    @wch
    Collaborator

    This is related to #1107, except that in this case, the jquery-ui is coming from ggvis.

    It looks like Bootstrap Datepicker now has a noconflict option, so we may be able to finally fix this. https://bootstrap-datepicker.readthedocs.io/en/stable/index.html#no-conflict-mode

  3. wch commented on Sep 1, 2016

    @wch
    Collaborator

    For future reference, here's the example as a single-file app:

    library(shiny)
    library(ggvis)
    
    server <- function(input, output) {
      mtcars_reactive <- reactive({ mtcars })
      mtcars_reactive %>% ggvis(~wt, ~mpg) %>% layer_points() %>% bind_shiny("plot")
    }
    
    ui <- fluidPage(
      dateRangeInput('dateRange', label = 'Date range: ', 
        start = '2016-08-15', end = '2016-08-25', max = '2016-08-26'),
      ggvisOutput('plot')
    )
    
    shinyApp(ui, server)
  4. added a commit that references this issue on Sep 17, 2016
    f87506e
  5. self-assigned this
    on Sep 17, 2016
  6. added a commit that references this issue on Sep 17, 2016
    2a9a7cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions