Skip to content

Commit

Permalink
don't send box id if tabsetpanel id is null in tabBox
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed May 26, 2021
1 parent eae7be5 commit fec6eb9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions R/cards.R
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ bs4InfoBox <- function(title, value = NULL, subtitle = NULL, icon = shiny::icon(
#' @family cards
#' @rdname tabBox
#'
#' @note User will access the \link{tabBox} input with input$<tabset_id>_box. This allows
#' @note User will access the \link{tabBox} input with input$<id>_box. This allows
#' to get the state of the box and update it on the server with \link{updateBox}.
#'
#' @examples
Expand Down Expand Up @@ -1223,8 +1223,8 @@ bs4TabCard <- function(..., id = NULL, selected = NULL, title = NULL, width = 6,
}

# add custom input id. User will access the tabBox input with input$<tabset_id>_box
boxTag$children[[1]]$attribs$id <- paste0(id, "_box")
boxTag$children[[2]]$attribs$`data-for` <- paste0(id, "_box")
boxTag$children[[1]]$attribs$id <- if (!is.null(id)) paste0(id, "_box")
boxTag$children[[2]]$attribs$`data-for` <- if (!is.null(id)) paste0(id, "_box")
boxTag
}

Expand Down
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ articles:
improved-boxes: improved-boxes.html
more-skins: more-skins.html
step-by-step: step-by-step.html
last_built: 2021-05-26T12:12Z
last_built: 2021-05-26T12:58Z

6 changes: 3 additions & 3 deletions docs/reference/tabBox.html

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

6 changes: 3 additions & 3 deletions man/tabBox.Rd

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

0 comments on commit fec6eb9

Please sign in to comment.