Skip to content

Commit

Permalink
Remove call to shiny::useBusyIndicators() (#1092)
Browse files Browse the repository at this point in the history
* Follow up to #1053: enable busy indicators by default for more scenarios

* Resave data (GitHub Action)

* Update NEWS.md

Co-authored-by: Garrick Aden-Buie <[email protected]>

* Include useBusyIndicators() as a separate htmlDependency()

* Remove any use/mention of busy indicators

---------

Co-authored-by: cpsievert <[email protected]>
Co-authored-by: Garrick Aden-Buie <[email protected]>
  • Loading branch information
3 people authored Jul 24, 2024
1 parent fd5c97d commit ed5ba51
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 19 deletions.
4 changes: 0 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# bslib (development version)

## New features

* Page functions (e.g., `page_fixed()`, `page_fluid()`, etc) now include `shiny::useBusyIndicators()` automatically if available. If this behavior isn't desirable (perhaps because a package like `{shinycssloaders}` is being used to indicate busy state), then disable by putting `shiny::useBusyIndicators(spinners=FALSE, pulse=FALSE)` in the page. (#1053)

## Improvements

* Adjusted the border color of checkbox and radio buttons to match the border color of the input group in `bs_theme(preset="shiny")`. (#1038)
Expand Down
11 changes: 2 additions & 9 deletions R/page.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @seealso Dashboard-style pages: [page_sidebar()], [page_navbar()],
#' [page_fillable()].
#'
#'
#' @describeIn page A \pkg{bslib} wrapper for [shiny::bootstrapPage()], a basic
#' Boostrap page where the content is added directly to the page body.
#'
Expand All @@ -30,19 +30,12 @@ page <- function(..., title = NULL, theme = bs_theme(), lang = NULL) {
theme = theme,
lang = lang,
# Components require Bootstrap 5+
if (isTRUE(theme_version(theme) >= 5)) component_dependencies(),
use_busy_indicators()
if (isTRUE(theme_version(theme) >= 5)) component_dependencies()
),
theme = theme
)
}

use_busy_indicators <- function() {
# Use busy indicators were added in shiny 1.8.1.9001 (after 1.8.1.1)
ubi <- asNamespace("shiny")[["useBusyIndicators"]]
if (!is.null(ubi)) ubi()
}

#' @describeIn page A \pkg{bslib} wrapper for [shiny::fluidPage()], a fluid
#' Bootstrap-based page layout that extends to the full viewport width.
#' @inheritParams shiny::fluidPage
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
4 changes: 0 additions & 4 deletions tests/testthat/_snaps/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
<script data-bslib-sidebar-init>bslib.Sidebar.initCollapsibleAll()</script>
</div>
</body>
<script>document.documentElement.dataset.shinyBusySpinners = 'true';
document.documentElement.dataset.shinyBusyPulse = 'true';</script>

---

Expand All @@ -78,6 +76,4 @@
<script data-bslib-sidebar-init>bslib.Sidebar.initCollapsibleAll()</script>
</div>
</body>
<script>document.documentElement.dataset.shinyBusySpinners = 'true';
document.documentElement.dataset.shinyBusyPulse = 'true';</script>

2 changes: 0 additions & 2 deletions tests/testthat/_snaps/page/modern-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

</head>
<body>A simple page without bs3compat dependencies</body>
<script>document.documentElement.dataset.shinyBusySpinners = 'true';
document.documentElement.dataset.shinyBusyPulse = 'true';</script>
</html>

0 comments on commit ed5ba51

Please sign in to comment.