I am encountering an issue when trying to incorporate a modal dialog with a specific CSS style within a R Shiny app. Individually, I can successfully implement a modal dialog without the CSS style and apply the CSS style without any issues. However, when attempting to display the modal dialog alongside the CSS style, the modal dialog fails to appear.
To replicate this issue, you can utilize the following code. The CSS stylesheet I am using is 'flatly' from and should be saved in a subdirectory named www
. To observe the different outcomes, you can comment and uncomment the line theme = "bootstrap-flatly.css"
:
shinyApp(ui=fluidPage(
theme = "bootstrap-flatly.css",
h1("Heading"),
div("Some text"),
selectInput("selectInput", "SomeInput", c(1,2,3), selected = NA, multiple = TRUE),
actionButton("print", "print")
),
server <- function(input, output){
showModal(modalDialog(
title = "My message",
easyClose = FALSE,
footer = actionButton("closemodal", "OK")
))
observeEvent(
{
input$closemodal
},{
removeModal()})
observeEvent(input$print, reactiveValuesToList(input) %>% print)
}
)
I am seeking assistance in understanding this behavior and would appreciate any guidance on how to successfully apply the CSS style to my modal dialog.