diff --git a/R/module_nested_tabs.R b/R/module_nested_tabs.R index e26533cc9..528b18bb1 100644 --- a/R/module_nested_tabs.R +++ b/R/module_nested_tabs.R @@ -347,8 +347,8 @@ srv_teal_module.teal_module <- function(id, .resolve_module_datanames <- function(data, modules) { stopifnot("data_rv must be teal_data object." = inherits(data, "teal_data")) - if (is.null(modules$datanames) || identical(modules$datanames, "all")) { - names(data) + if (is.null(modules$datanames) || setequal(modules$datanames, "all")) { + setdiff(names(data), attr(modules$datanames, "excluded")) } else { intersect( names(data), # Keep topological order from teal.data::names() diff --git a/R/modules.R b/R/modules.R index 2b27d5bb4..76759c016 100644 --- a/R/modules.R +++ b/R/modules.R @@ -610,7 +610,13 @@ set_datanames <- function(modules, datanames) { modules$children <- lapply(modules$children, set_datanames, datanames) } else { if (identical(modules$datanames, "all")) { - modules$datanames <- datanames + included <- grep("^[^-]", datanames, value = TRUE) + if (length(included)) { + modules$datanames <- included + } else { + excluded <- gsub("^-", "", grep("^-", datanames, value = TRUE)) + attr(modules$datanames, "excluded") <- excluded + } } else { warning( "Not possible to modify datanames of the module ", modules$label,