Skip to content

Commit

Permalink
Add static_backdrop option to wizard modal; bsutils has a bug on stat…
Browse files Browse the repository at this point in the history
…ic backdrop that needs fix
  • Loading branch information
mauromiguelm committed Feb 15, 2024
1 parent 6265a09 commit 9f7eb59
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions R/wizard.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @param id wizard id
#' @param modal modal
#' @param modal_size modal size (default, sm, lg, xl, fullscreen, fullscreen-sm-down, fullscreen-md-down, fullscreen-lg-down, fullscreen-xl-down, fullscreen-xxl-down)
#' @param static_backdrop close modal on when clicking outside of the modal
#' @param options A list of options. See the documentation of
#' 'Wizard-JS' (<URL: https://github.com/AdrianVillamayor/Wizard-JS>) for
#' possible options.
Expand All @@ -25,7 +26,8 @@ wizard <- function(
id = NULL,
modal = TRUE,
options = list(),
modal_size = "xl"
modal_size = "xl",
static_backdrop = FALSE
){

# check inputs
Expand All @@ -36,6 +38,11 @@ wizard <- function(
if(!is.logical(show_buttons)){
stop("show_buttons must be logical")
}

# check if static_backdrop is logical
if(!is.logical(static_backdrop)){
stop("static_backdrop must be logical")
}

size = c(
"default",
Expand Down Expand Up @@ -84,12 +91,13 @@ wizard <- function(
if (is.null(id)) {
stop("id must be provided if modal is TRUE")
}

ui <- (
bsutils::modal(
id = id,
ui,
size = modal_size
size = modal_size,
static_backdrop = static_backdrop
)
)
}
Expand Down

0 comments on commit 9f7eb59

Please sign in to comment.