我在Shiny模板下创建了我面临的问题以完全显示selectInput()
library(shiny)
ui = shinyUI(
fluidPage(
div(
div(style = "margin-top: 110px;",
wellPanel(
column(12, style = "background-color:WhiteSmoke; height:123px; margin: 0; padding: 0;",
splitLayout(cellWidths = c('60%', '30%'),
div(id = 'bb', style = "background-color: #e8e8e8; border-radius: 5px; padding: 20px 0px 10px 20px;",
splitLayout(cellWidths = c('55%', '40%'),
div(id = 'aa', style = "z-index: 20000;",
selectInput(inputId = "Pick", label = "Chose", choices = c('A', 'B', 'C'),
selected = NULL, multiple = FALSE, selectize = TRUE, size = NULL, width = 300))
))))
)
)
)))
server = function(input, output, session) {
}
shinyApp(ui = ui, server = server)
当您单击selectInput()
的下拉列表时,整个元素都没有显示出来,它被周围的div
掩盖了。
如何解决这个问题的任何想法将不胜感激。我尝试调整z索引,但是无法成功。
谢谢,
要考虑"完成"的问题,您可以如我在评论中提到的删除splitLayouts
:
library(shiny)
ui = shinyUI(
fluidPage(
div(
div(style = "margin-top: 110px;",
wellPanel(
column(12, style = "background-color:WhiteSmoke; height:123px; margin: 0; padding: 0;",
div(id = 'bb', style = "background-color: #e8e8e8; border-radius: 5px; padding: 20px 0px 10px 20px;",
div(id = 'aa', style = "z-index: 20000;",
selectInput(inputId = "Pick", label = "Chose", choices = c('A', 'B', 'C'),
selected = NULL, multiple = FALSE, selectize = TRUE, size = NULL, width = 300))
))
)
)
)))
server = function(input, output, session) {
}
shinyApp(ui = ui, server = server)