RinteRface / shinydashboardPlus

extensions for shinydashboard
https://shinydashboardplus.rinterface.com
Other
454 stars 77 forks source link

Opening the right sidebar doesn' trigger resize event #86

Closed ismirsehregal closed 3 years ago

ismirsehregal commented 3 years ago

Coming from here.

I'm not sure if this behaviour is intended or not, but currently when opening the right sidebar plots aren't resized. However, they are resized once the browser window is resized:

problem

To me it seems it is quite the same issue as this one in shinydashboard

I adapted their fix for the right sidebar (comment out the script tag to reproduce the issue):

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

header <- dashboardHeaderPlus(enable_rightsidebar = TRUE,
                              rightSidebarIcon = "filter")

sidebar <- dashboardSidebar()
body <- dashboardBody(
  tags$script('
      $(".navbar-custom-menu").on("click",function(){
        $(window).trigger("resize");
      })'
  ),
  fluidPage(
    plotOutput(
      "scatter",
      height = "700px",
      width = "100%"
    )
  ))

rightsidebar <- rightSidebar()

ui <- dashboardPagePlus(header,
                        sidebar,
                        body,
                        rightsidebar)

server <- function(input, output) {
  output$scatter <- renderPlot({
    plot(1:10)
  })
}

shinyApp(ui, server)

Which results in the expected behaviour: expected

ismirsehregal commented 3 years ago

85 was it a duplicate? I'm confused. (Edit: was actually fixed in b1cfbf8)

DivadNojnarg commented 3 years ago

Nope. I closed the wrong issue