rstudio / shiny

Easy interactive web applications with R
https://shiny.posit.co/
Other
5.37k stars 1.87k forks source link

The Z-index of modals has problems with selectizeInput #3448

Closed apalacio10 closed 3 years ago

apalacio10 commented 3 years ago

Hello,

The Z-index of modals has problems with selectizeInput in the developer version. The drop-down list appears behind the modal.

imagen

library(shiny)

theme <- bslib::bs_theme(version = 4,bootswatch = "cyborg",bg="#323232",fg="#FFFFFF","body-bg"="#323232",primary = "#002860",
                         secondary  = "#6E6E6E",success = "#02A502",info="#00AADD",warning = "#FA9300",danger = "#F0302B","input-border-color"="#000000",
                         base_font = "Helvetica Neue",heading_font = "Helvetica Neue")

ui <- fluidPage(theme = theme,

    actionButton("test","Test")
)

server <- function(input, output) {

    observeEvent(input$test,{

        showModal(
            modalDialog(
                title ="Test",
                size="l",
                selectizeInput("bins",
                               "Number of bins:",
                               choices=c(1,2,3,4,5)),
                easyClose = F)
            )

    })

}

shinyApp(ui = ui, server = server)
cpsievert commented 3 years ago

Thanks, looks like this issue was introduced by https://github.com/rstudio/shiny/pull/3413 (it has nothing to do with bslib). Here's a more minimal example:

library(shiny)
ui <- fluidPage(
  actionButton("test","Test")
)

server <- function(input, output) {

  observeEvent(input$test,{

    showModal(
      modalDialog(
        title ="Test",
        size="l",
        selectizeInput("bins",
                       "Number of bins:",
                       choices=c(1,2,3,4,5)),
        easyClose = F)
    )

  })

}

shinyApp(ui = ui, server = server)