Allow to specify disconnect overlay template
This PR adds an overridable <template> that, when present, is used to fill the grey-out div when it is generated.
This can be used to customize the content of the disconnect overlay (without the need for extra JS from the user).
This is a POC implementation of my suggestion in https://github.com/rstudio/shiny/issues/1828
The only downside is that this does not properly support IE (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#browser_compatibility).
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Can you provide an example of how the application author would use this?
I've been using the following example for testing:
shiny::shinyApp(
ui = function(request) {
shiny::tags$body(
shiny::fluidPage(),
shiny::tags$template(
id = "shiny-disconnected-overlay-template",
shiny::tags$div("some content")
)
)
},
server = function(input, output, session) {
stop("something happened")
}
)
If I understand the code correctly, wouldn't this also work (without the call to body())?
shinyApp(
ui = fluidPage(
"Page content",
tags$template(
id = "shiny-disconnected-overlay-template",
tags$div("some content")
)
),
server = function(input, output, session) {
stop("something happened")
}
)
And I don't think the changes in shinyui.R are needed.
that would also work. I put the <template> under <body> to have it at the same level as the shiny-disconnected-overlay div (seemed to be the general practice, but the template spec is flexible enough), but this can be totally left to application author.
point taken about the changes to shinyui.R; removed them
rebased to resolve conflicts
@wch anything else I can do from my side? ci was reporting a 403 trying to access my forked repo; not sure how to resolve that: it's public