diff --git a/DESCRIPTION b/DESCRIPTION index 301b298..1a285e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: dv.filter Title: Dynamic Data Filtering Module -Version: 3.0.0 +Version: 3.0.1 Authors@R: c( person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")), person("Ming", "Yang", email = "ming.yang.ext@boehringer-ingelheim.com", role = c("aut", "cre")), diff --git a/NEWS.md b/NEWS.md index 219159b..e01e7c5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# dv.filter 3.0.1 + +- Fixes filter lack of reaction to dataset changes [#8](https://github.com/Boehringer-Ingelheim/dv.filter/issues/8) + # dv.filter 3.0.0 - GitHub release with QC report diff --git a/R/data_filter_server.R b/R/data_filter_server.R index 135b595..2ba42a5 100644 --- a/R/data_filter_server.R +++ b/R/data_filter_server.R @@ -189,6 +189,17 @@ data_filter_server <- function(id, data) { }, ignoreInit = TRUE ) + + # The first thing that should happen when the dataset changes is that returned becomes NULL + # Allows the caller to know that all filters have changed in a multifilter scenario + # + shiny::observeEvent(data(), + { + returned(NULL) + }, + priority = 1 + ) + # Do not update the filter unless there has been any change in the returned vector # The returned attribute maybe inconsistent, as filterings that return exactly the same # logical vector may not update the expression attribute. @@ -200,7 +211,7 @@ data_filter_server <- function(id, data) { shiny::observeEvent( selected(), { - if (is.null(returned()) || !all(selected() == returned())) { + if (is.null(returned()) || !identical(selected(), returned())) { returned(selected()) } }