rstudio / htmltools

Tools for HTML generation and output
https://rstudio.github.io/htmltools/
213 stars 67 forks source link

`bindFillRole()` should attach its `HTMLDependency()` to fill items #421

Closed cpsievert closed 4 months ago

cpsievert commented 8 months ago

With this change, something like this now works:

div(class = "html-fill-container", bindFillRole(div(), item = TRUE))

The importance of which has increased since the emergence of div(bslib::as_fillable_container()), which only adds the HTML classes (not the dependencies).

And since bslib::page_fillable() uses as_fillable_container(), this currently doesn't work:

library(shiny)
library(plotly)
library(bslib)

ui <- page_fillable(
  plotlyOutput("p")
)

server <- function(input, output) {
  output$p <- renderPlotly({
    plotly::plot_ly()
  })
}

shinyApp(ui, server)