Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions R/append.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ bs_append.shiny.tag <- function(tag, ...){
stop("This shiny.tag is not supported")
}

#' @param show logical, indicates whether to show content of first panel
#' @rdname bs_accordion
#' @export
#'
bs_append.bsplus_accordion <- function(tag, title, content, ...){
bs_append.bsplus_accordion <- function(tag, title, content, show = TRUE, ...){

# characterize the existing accordion
n_panel <- length(tag$children)
Expand Down Expand Up @@ -101,7 +102,7 @@ bs_append.bsplus_accordion <- function(tag, title, content, ...){
collapse <- bs_set_aria(collapse, labelledby = id_heading)

# if this is the first panel, set it as open (add option to suppress)
if (identical(n_panel, 0L)){
if (identical(n_panel, 0L) & show){
collapse <- htmltools::tagAppendAttributes(collapse, class = "in")
}

Expand Down
5 changes: 4 additions & 1 deletion man/bs_accordion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.