0

the given R Shiny script below creates a box panel with multiple selectInputs, If you click on any selectInput, the slider appears within the box itself, kindly help me to make it appear outside the box and also without modifying the alignment of the box panel and the inputs, in simple terms, "splitlayout" needs a fix. Note: Alignment is very important and please don't alter it. Thanks

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 Capture

Adam Shaw
  • 519
  • 9
  • 24
  • Instead of using splitLayout you could use `fluidRows` and `columns` and do something like [this](https://stackoverflow.com/a/46907117/5894457) – SBista Jan 23 '18 at 09:26
  • @SBista, no questions to your solution, but as I said, I have the alignment also to look after, the selectInputs span the box end to end,, this is achieved using splitLayout, please help me in this regard, else if you can ensure the alignment some other way should be great, please suggest. – Adam Shaw Jan 23 '18 at 09:38

1 Answers1

1

If you don't find a better solution, forcing css (overflow of shiny-split-layout) value should help.

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)
amrrs
  • 6,215
  • 2
  • 18
  • 27