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

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

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Nov 9, 2023

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)

@cpsievert cpsievert requested a review from gadenbuie November 9, 2023 16:18
Copy link
Member

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. I was assuming that bindFillRole() always added the fill dependency, not just to containers, so I think making that explicitly the case is a positive move.

@cpsievert cpsievert merged commit 7414232 into main Mar 11, 2024
5 of 6 checks passed
@cpsievert cpsievert deleted the bindFillDepsAlways branch March 11, 2024 16:12
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

Successfully merging this pull request may close these issues.

2 participants