Skip to content

Commit

Permalink
bindFillRole() should attach its HTMLDependency() to fill items (#…
Browse files Browse the repository at this point in the history
…421)

* bindFillRole() should attach its HTMLDependency() to fill items

* Update news
  • Loading branch information
cpsievert authored Mar 11, 2024
1 parent a8a3559 commit 7414232
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# htmltools (development version)

## Bug fixes

* `bindFillRole()` now attaches its `HTMLDependency()` to fill items, thus reducing the possibility of filling layout breaking due to missing CSS. (#421)


# htmltools 0.5.7

## New Features
Expand Down
2 changes: 1 addition & 1 deletion R/fill.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bindFillRole <- function(x, ..., item = FALSE, container = FALSE, overwrite = FA
class = if (container) "html-fill-container"
)

if (container) {
if (container || item) {
x <- attachDependencies(x, fillDependencies(), append = TRUE)
}

Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-fill.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ test_that("asFillContainer() and asFillItem()", {
expect_true(
doRenderTags(x) == "<div class=\"html-fill-container\"></div>"
)
expect_equal(htmlDependencies(x), list(fillDependencies()))

x <- bindFillRole(div(), item = TRUE)
expect_true(
doRenderTags(x) == "<div class=\"html-fill-item\"></div>"
)
expect_equal(htmlDependencies(x), list(fillDependencies()))

x <- bindFillRole(x, container = TRUE, overwrite = TRUE)
expect_true(
Expand Down

0 comments on commit 7414232

Please sign in to comment.