Skip to content

Commit

Permalink
Two quick fixes for sidebar mobile/desktop options (#950)
Browse files Browse the repository at this point in the history
* fix(sidebar): open="desktop" resolves to `"closed"` on mobile
* fix(toggle_sidebar): `"toggle"` is a valid `open` value
  • Loading branch information
gadenbuie authored Dec 20, 2023
1 parent 3140888 commit c1979d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/sidebar.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ as_sidebar_open_on <- function(open) {
if (length(open) == 1) {
open <- sidebar_open_as_string(open, extra = "desktop", rlang::caller_env())
if (identical(open, "desktop")) {
return(sidebar_open_on("open", "always"))
return(sidebar_open_on("open", "closed"))
}
return(sidebar_open_on(open, open))
}
Expand Down Expand Up @@ -396,7 +396,7 @@ layout_sidebar <- function(
#' used).
#' @export
toggle_sidebar <- function(id, open = NULL, session = get_current_session()) {
method <- sidebar_open_as_string(open %||% "toggle")
method <- sidebar_open_as_string(open %||% "toggle", "toggle")

if (identical(method, "always")) {
abort('`open = "always"` is not supported by `sidebar_toggle()`.')
Expand Down

0 comments on commit c1979d0

Please sign in to comment.