Is there a way to hide/disable the `Close` button on a `bsModal` window?

后端 未结 2 1473
栀梦
栀梦 2021-01-21 01:52

A bsModal window in shiny app comes with a default Close button. Is there a way that can be disabled? I tried to look up on SO for similar

2条回答
  •  鱼传尺愫
    2021-01-21 02:29

    This should do it

    library(shiny)
    library(shinyBS)
    
    if(interactive()){
      shinyApp(
        ui <- fluidPage(
          actionButton("open", "Open"), #action button to trigger the modal window.
          bsModal("id1", "Box 1", "open", size = "small",
                  HTML(paste("A simple modal window.")),
                  tags$head(tags$style("#id1 .modal-footer{ display:none}"))
          )
        ),
    
        server <- function(input,output,session){
    
        }
      )
    }
    

提交回复
热议问题