0

下面给定的 R Shiny 脚本创建了一个带有多个 selectInputs 的框面板,如果单击任何 selectInput,滑块会出现在框本身内,请帮助我使其出现在框外,并且无需修改框面板的对齐方式和输入,简单来说,“splitlayout”需要修复。注意:对齐非常重要,请勿更改。谢谢

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
box(title = "Data", status = "primary", solidHeader = T, width = 12,
    splitLayout(
      cellArgs = list(style = "padding: 10px"),
      selectInput("select1","select1",c("A1","A2","A3"), selected = "A1"),
      selectInput("select2","select2",c("A3","A4","A5"), selected = "A3"),
       selectInput("select2","select2",c("A3","A4","A5"), selected = "A3"),
         selectInput("select2","select2",c("A3","A4","A5"), selected = 
 "A3"),
         selectInput("select2","select2",c("A3","A4","A5"), selected = "A3")
    ))))
 server <- function(input, output) { }
 shinyApp(ui, server)

BoxPanel 捕获

4

1 回答 1

1

如果您没有找到更好的解决方案,强制 css ( overflowof shiny-split-layout) 值应该会有所帮助。

library(shiny)
library(shinydashboard)
ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    tags$head(tags$style(HTML('.shiny-split-layout>div {overflow:visible}')))
  ),
  dashboardBody(
    box(title = "Data", status = "primary", solidHeader = T, width = 12,
        splitLayout(
          cellArgs = list(style = "padding: 10px"),
          selectInput("select1","select1",c("A1","A2","A3"), selected = "A1"),
          selectInput("select2","select2",c("A3","A4","A5"), selected = "A3"),
          selectInput("select2","select2",c("A3","A4","A5"), selected = "A3"),
          selectInput("select2","select2",c("A3","A4","A5"), selected = 
                        "A3"),
          selectInput("select2","select2",c("A3","A4","A5"), selected = "A3")
        ))))
server <- function(input, output) { }
shinyApp(ui, server)
于 2018-01-23T09:51:49.447 回答