daattali / shinycssloaders

⌛ Add loading animations to a Shiny output while it's recalculating
https://daattali.com/shiny/shinycssloaders-demo/
Other
395 stars 45 forks source link

Texts are centered in the output when using an image as a spinner. #79

Closed YonghuiDong closed 1 year ago

YonghuiDong commented 1 year ago

Hi Dean Attali,

Thanks a lot for this great package.

I find out that the texts are centered in the output when using an image inwithSpinner() function.

Please see the example below (Sorry the image is not shown properly). How can I left align the output text?

Thanks lot.

Dong

library(shiny)

ui <- fluidPage(
  actionButton("go", "Go"),
  shinycssloaders::withSpinner(
    verbatimTextOutput("test"), 
    image = "https://imgur.com/gallery/XUomVWX"
  )
)
server <- function(input, output) {
  output$test <- renderPrint({
    input$go
    Sys.sleep(1.5)
    cat("R version 4.2.2 (2022-10-31) 
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)")
  })
}
shinyApp(ui, server)
daattali commented 1 year ago

Thanks for providing a reproducible example! This is indeed a bug that I never noticed. I'll take a look when I can.

daattali commented 1 year ago

Should be fixed now, please test it and let me know if it works or not for you.

YonghuiDong commented 1 year ago

It works perfectly now.

Thanks a lot!

Dong

daattali commented 1 year ago

I see you live in my home country! Shabbat shalom :)

YonghuiDong commented 1 year ago

@daattali,

Wow, I did not realize that you are Israeli. Shabbat shalom to you as well.

Dong