rstudio / shinydashboard

Shiny Dashboarding framework
https://rstudio.github.io/shinydashboard/
Other
896 stars 298 forks source link

Maximizing tabBox with a sidebar will add a horizontal Scrollbar to the box #383

Closed fsalemi closed 2 years ago

fsalemi commented 2 years ago

I am using a sidebar inside a box in shinyDashboard, which is working perfectly. However when I maximize the box, it will add an unnecessary horizontal scrollbar to the box. I tried disabling it with the following CSS style code:

tags$style("body {overflow-x: hidden !important; }")

But it does not work. Does anyone know how to remove the scrollbar? Here is a simple reproducible code:

# Toggle a box sidebar
library(shiny)
library(bs4Dash)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    body = dashboardBody(
      tags$style("body {overflow-x: hidden !important; }"),
      box(
        height = "500px",
        width = 12,
        maximizable = T,
        solidHeader = FALSE,
        collapsible = TRUE,
        sidebar = boxSidebar(
          id = "mycardsidebar",
          width = 30,
          p("Sidebar Content")
        )
      )
    ),
    sidebar = dashboardSidebar()
  ),
  server = function(input, output, session) {}
)

Any help would be highly appreciated.

YongbingDing commented 2 years ago

您好,丁永兵已经收到您的邮件,谢谢。

fsalemi commented 2 years ago

Thanks Ding Yongbing.

fsalemi commented 2 years ago

This issue is resolved.