Closes the overlay; if it was shown with transient = TRUE (the default),
closing is also what removes it from the document, so this is all you need.
For a transient = FALSE overlay this only closes it – it stays available
for shad_dialog_open().
Usage
shad_remove_dialog(id, session = shiny::getDefaultReactiveDomain())Details
Overlays close themselves on Esc, on a backdrop press, and via
shad_dialog_close_button(), so calling this is only necessary when the
server decides to dismiss one (a completed job, a timeout, a successful
save).
See also
Other shadshiny server API:
bind_shad_task_button(),
shad_message_scroller_to_bottom(),
shad_overlay_server,
shad_show_dialog(),
shad_toast(),
update_shad,
update_shad_command()
Examples
if (interactive()) {
ui <- page_shad(shad_button("Save", inputId = "save"))
server <- function(input, output, session) {
shiny::observeEvent(input$save, {
shad_show_dialog(shad_dialog(
"saved", title = "Saved", "Your changes were saved.",
footer = shad_button("Done", inputId = "done")
))
})
shiny::observeEvent(input$done, shad_remove_dialog("saved"))
}
shiny::shinyApp(ui, server)
}