Yang-Tang / shinyjqui

jQuery UI Interactions and Effects for Shiny
https://yang-tang.github.io/shinyjqui/
Other
271 stars 32 forks source link

jqui_resizable blocked by other elements if nested in tagList? #85

Open Toniiiio opened 2 years ago

Toniiiio commented 2 years ago

Thanks for the great package!

Consider the following code. It has three elements. But if you uncomment jqui_resizable(leafletOutput('myMap')), the two dygraphs are not resizable any more.

However, if i do not nest the outputs in a tagList it also seems to work.

# works 
jqui_resizable(leafletOutput('myMap')),
jqui_resizable(dygraphOutput("rew", height = "100px")),
jqui_resizable(dygraphOutput("rew2", height = "100px"))

So my assumption would be that jqui_resizable() is blocked (if nested in tagList()) by another element ? For my use case not using tagList() as a workaround is hardly possible.

Thanks for any help!

Reproducible example:

library(shiny)
library(leaflet)
library(dygraphs)
library(shinyjqui)

ui <- fluidPage(
  # jqui_resizable(leafletOutput('myMap')),
  # jqui_resizable(dygraphOutput("rew", height = "100px")),
  # jqui_resizable(dygraphOutput("rew2", height = "100px"))
  uiOutput("xx")
)

server <- function(input, output, session) {
  map = leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 17)
  output$myMap = renderLeaflet(map)

  output$rew <- renderDygraph({
    dygraph(ldeaths)
  })

  output$rew2 <- renderDygraph({
    dygraph(mdeaths)
  })

  output$xx <- renderUI({
    out <- tagList()
    out <- tagList(out, jqui_resizable(dygraphOutput("rew", height = "100px")))
    out <- tagList(out, jqui_resizable(dygraphOutput("rew2", height = "100px")))
    out
  })
}

shinyApp(ui, server)
Yang-Tang commented 2 years ago

Thanks for bringing me to this. Looks like it's a bug. I'll let you know if I find any clue