闪亮的仪表板;最大化带有侧边栏的 tabBox 会在框中添加一个水平滚动条吗?
shinyDashboard; Maximizing tabBox with a sidebar will add a horizontal Scrollbar to the box?
我在 shinyDashboard 的盒子里使用侧边栏,效果很好。但是,当我最大化该框时,它会向该框添加一个不必要的水平滚动条。我尝试使用以下 CSS 样式代码禁用它:
tags$style("body {overflow-x: hidden !important; }")
但是不行。有谁知道如何删除滚动条?
这是一个简单的可重现代码:
# 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) {}
)
非常感谢任何帮助。
我试着改进了 css 一点
# Toggle a box sidebar
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
body = dashboardBody(
tags$style(".card.maximized-card .card-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) {}
)
我在 shinyDashboard 的盒子里使用侧边栏,效果很好。但是,当我最大化该框时,它会向该框添加一个不必要的水平滚动条。我尝试使用以下 CSS 样式代码禁用它:
tags$style("body {overflow-x: hidden !important; }")
但是不行。有谁知道如何删除滚动条? 这是一个简单的可重现代码:
# 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) {}
)
非常感谢任何帮助。
我试着改进了 css 一点
# Toggle a box sidebar
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
body = dashboardBody(
tags$style(".card.maximized-card .card-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) {}
)