shiny icon indicating copy to clipboard operation
shiny copied to clipboard

Make disconnected overlay sizing styles stronger

Open nstrayer opened this issue 4 years ago • 1 comments

If you have an app with a rather innocent line of css that restricts sizes of children of the body such as: body > div { max-width: 400px; max-height: 400px; } this will cause the disconnected overlay div to be too small as well.

This would be fine if it still covered the children, but because of the styles of left, right, top, bottom being set explicitly it will always be stuck to the upper-left of the viewport. Here's a minimum app example where the aforementioned styles were used to make the content horizontally centered on the screen and not allowed to get too big.

library(shiny)
shinyApp(
  ui = fluidPage(
    tags$head(
      tags$style(
        HTML("body > div { max-width: 400px; max-height: 400px; }
              #content { margin: 0 auto; background: salmon; }")
      )
    ),
    div(id = "content", "Here's my content")
  ),
  server = function(input, output) {}
)

Current behavior

If we run this app and then the disconnected overlay gets triggered (by simply killing the app process) we get this rather confusing result: image

New behavior

And here's the result after the changes in this PR: image

nstrayer avatar Jul 02 '21 19:07 nstrayer

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 08 '23 16:11 CLAassistant