-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unable to see spinner when parent is using display: flex #85
Comments
There's quite a lot going on here,- using page_navbar, nav_panel, custom classes on the tab, and finally the classes that are mentioned in the bug report. Could you please reduce the reprex to the bare minimum? If there's an issue with d-flex and justify-content-center classes, then show a barebones shiny app with a spinner wrapped in those classes, with nothing else. Thanks for the report, I'll take a look when the code is more minimal! |
Thanks @daattali -- here's a more stripped down example:
Seems like just the introduction of |
Thanks - using your new information I was able to narrow it down to the fact that shinycssloaders doesn't work when it's inside a flexbox. Here's the minimal reprex I came up with: library(shiny)
ui <- fluidPage(
div(style="display: flex;", shinycssloaders::withSpinner(textOutput("text")))
)
server <- function(input, output) {
output$text <- renderText({
Sys.sleep(2)
"some text"
})
}
shinyApp(ui, server) I have a feeling this might be a difficult one to solve correctly. I noticed that if I remove this one CSS line:
then the spinner does show up. But I can't simply remove it, because that CSS rule was literally the first CSS rule used in this package, and all the features depend on it. I don't know what features or usecases might break if it's removed. Someone would need to do a lot of careful testing of different shinycssloaders examples to see if it's ok to remove that line, or alternatively if anything can be added to to allow flexboxes to work. If you need this to work ASAP, you can fork this project, and remove that line, and if it works for your usecase then just use your forked version. |
Ah, understood. At least now we could 'hack' an ID and force its position to be static. FWIW, this works in the minimal examples:
I tried some things with conditional styling (and that might be a decent long-term approach), but wasn't successful. I'm thinking something close to this could work in
|
I'm not inclined to use a solution like that, not just because such CSS selectors are not performant, but it's also a little too hacky/unclean for my taste! I'd prefer finding a cleaner approach |
Looks like something is happening to the visibility of the spinner when using
d-flex
and/orjustify-content-center
:The text was updated successfully, but these errors were encountered: