R Shiny: automatic wrap bar interface

In my UI, I am trying to get my filter to appear in the wellpanel. When the application is launched, it looks like a drop-down menu, and the associated checkboxes are "on top" rather than wrapped inside it.

Here is a picture of what I mean: http://imgur.com/QJrrseT

Reproducible example:

User interface

    require(shiny)
    require(devtools)
    library(grDevices)
    library(xlsx)


shinyUI(fluidPage(
  fluidRow(
    column(3,
    wellPanel(
      )),
    column(9,
      fluidRow(
      wellPanel(
          column(3,
              uiOutput("filter1"))
        ))

    ))
))

      

server

shinyServer(function(input, output) {

 output$filter1 <- renderUI({
 selectInput("filter1", label="Filter 1", choices = c("No Filter","a","b"))
 })
})

      

+3


source to share


1 answer


You can add style wellPanel

to solve the problem:

library(shiny)
runApp(list(ui= fluidPage(
  fluidRow(
    column(3, wellPanel()),
    column(9,
           fluidRow( wellPanel(style = "overflow: hidden;", 
             column(3, uiOutput("filter1"))
           ))
    )
  )
)
, server = function(input, output) {

  output$filter1 <- renderUI({
    selectInput("filter1", label="Filter 1", choices = c("No Filter","a","b")
                , selectize = FALSE)
  })
})
)

      



enter image description here

+3


source







All Articles