dreamRs / esquisse

RStudio add-in to make plots interactively with ggplot2
https://dreamrs.github.io/esquisse
Other
1.76k stars 227 forks source link

Bug: insertTab() doesn't work when there is an esquisse module on the page #224

Closed daattali closed 1 year ago

daattali commented 1 year ago

Example:

library(shiny)

ui <- fluidPage(
  tabsetPanel(
    id = "tabs",
    tabPanel("tab1", esquisse::esquisse_ui("test")),
    tabPanel("tab2", "tab2")
  )
)

server <- function(input, output, session) {
  esquisse::esquisse_server("test", data_rv = reactiveValues(data=iris, name="iris"))
  insertTab("tabs", tabPanel("tab3", "tab3"))
}

shinyApp(ui, server)

The third tab doesn't work. If you remove the esquisse_ui, then it will work.

If you look at the javascript console, you'll see that there is an error when trying to add a tab with esquisse on the page.

pvictor commented 1 year ago

Hi, That's actually a bug in shinyWidgets, it's fixed if you re-install the package from GitHub :

remotes::install_github("dreamRs/shinyWidgets")

Victor

daattali commented 1 year ago

Fantastic! I guess I didn't isolate the bug closely enough to see which part exactly was causing the problem, I hope it didn't take you too much time to find the cause and fix. Thanks for the prompt work!

pvictor commented 1 year ago

Not hard to catch but a one I never see before.