Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block can change size of blocked element #32

Open
chlebowa opened this issue Feb 23, 2024 · 1 comment
Open

block can change size of blocked element #32

chlebowa opened this issue Feb 23, 2024 · 1 comment

Comments

@chlebowa
Copy link
Contributor

chlebowa commented Feb 23, 2024

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.

@pvictor
Copy link
Member

pvictor commented Feb 26, 2024

It seems to be a good workaround for the moment 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants