dreamRs/shinybusy

`block` can change size of blocked element

Opened this issue · 1 comments

block temporarily adds the .nx-block-temporary-positionclass to the blocked element, which has a min-height property assigned, which in turn can significantly change the size of the blocked element:

image
image

example app
library(shiny)
library(shinybusy)

ui <- fluidPage(
  # tags$head(tags$style(HTML("
  #   .nx-block-temporary-position {
  #     min-height: 0 !important;
  #   }"))),
  br(),
  wellPanel(
    actionButton("button", "button"),
    actionButton("block", "block")
  ),
)

server <- function(input, output, session) {
  observeEvent(input[["block"]], {
    block("button", text = "", type = "dots")
    Sys.sleep(5)
    unblock("button")
  })
}

shinyApp(ui, server)

I imagine this done deliberately to accommodate the text message but it can be problematic when blocking buttons.
In my case I used

.nx-block-temporary-position {
  min-height: 0 !important;
}

to override it.

It seems to be a good workaround for the moment 👍