diff --git a/R/f7Login.R b/R/f7Login.R index 57875646..aea213ab 100644 --- a/R/f7Login.R +++ b/R/f7Login.R @@ -42,6 +42,9 @@ cancellable = FALSE) { submitBttn ) } + + items <- list(...) + if (length(items) > 0) items <- change_id(items, ns) shiny::tags$div( id = sprintf("%s-login", id), @@ -68,7 +71,7 @@ cancellable = FALSE) { label = "Password", placeholder = "Your password here" ), - ... + items ), btnUI, if (!is.null(footer)) { diff --git a/R/utils.R b/R/utils.R index 614046cc..7cec8e85 100644 --- a/R/utils.R +++ b/R/utils.R @@ -234,3 +234,19 @@ create_app_link <- function( `data-external` = "1" ) } + +#' Change tags ids +#' +#' Changes the id of the shiny tags +#' and any nested element. +#' +#' @keywords internal +#' @noRd +change_id <- function(items, ns) { + lapply(items, \(item) { + full_ns <- ns(character(0)) + tmp <- strsplit(as.character(item), "\n")[[1]] + outer_ns <- strsplit(full_ns, "-")[[1]][1] + shiny::HTML(paste(gsub(sprintf("%s", outer_ns), full_ns, tmp), collapse = "\n")) + }) +}