From ba08c5e926178badd278e197e2d33ef511c8c858 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Wed, 20 Dec 2023 10:27:15 -0500 Subject: [PATCH 1/2] fix(sidebar): open="desktop" resolves to `"closed"` on mobile --- R/sidebar.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/sidebar.R b/R/sidebar.R index 0b1aecfa7..27dcfdaf5 100644 --- a/R/sidebar.R +++ b/R/sidebar.R @@ -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)) } From 2f2b92af84d8ed0202b7c26f34d5b08fef6fe290 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Wed, 20 Dec 2023 10:27:41 -0500 Subject: [PATCH 2/2] fix(toggle_sidebar): `"toggle"` is a valid `open` value --- R/sidebar.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/sidebar.R b/R/sidebar.R index 27dcfdaf5..67b8c7ab3 100644 --- a/R/sidebar.R +++ b/R/sidebar.R @@ -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()`.')