-
Couldn't load subscription status.
- Fork 65
Closed
Description
This issue was introduced by Shiny.renderContent() becoming async (in rstudio/shiny#3904).
In hindsight, it's quite obviously a bad idea for Shiny.renderContent() to always be async since, with any insert-like operation, users are going to expect that the operation to have finished before the next line of R code happens. Here's an example of that:
app.Rremotes::install_github("rstudio/shiny")
library(bslib)
library(shiny)
ui <- page_fixed(
accordion(
id = "acc", multiple = TRUE,
accordion_panel("A", "a"),
accordion_panel("B", "b")
)
)
server <- function(input, output) {
observe({
# Triggers a Shiny.renderContent()
accordion_panel_insert(
"acc", accordion_panel("C", "c")
)
# Relies on the content being rendered
accordion_panel_open("acc", "C")
})
}
shinyApp(ui, server)Going forward, it seems like it'd be a lot better to revert changes made to srcts/src/shiny/render.ts (except for the awaits in renderContentAsync()).
Metadata
Metadata
Assignees
Labels
No labels