Skip to content

Commit

Permalink
Merge pull request #13 from Boehringer-Ingelheim/rc/3.0.1hotfix
Browse files Browse the repository at this point in the history
rc/v3.0.2 hotfix
  • Loading branch information
zsigmas authored Oct 8, 2024
2 parents 6da6da9 + a305c9c commit 6aef0d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: dv.filter
Title: Dynamic Data Filtering Module
Version: 3.0.1
Version: 3.0.2
Authors@R: c(
person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")),
person("Ming", "Yang", email = "[email protected]", role = c("aut", "cre")),
Expand Down
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# dv.filter 3.0.1
# dv.filter 3.0.2

- Hotfix preventing spurious updates due to strategy change for equal filtering states

# dv.filter 3.0.2

- Fixes filter lack of reaction to dataset changes [#8](https://github.com/Boehringer-Ingelheim/dv.filter/issues/8)

Expand Down
7 changes: 6 additions & 1 deletion R/data_filter_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ data_filter_server <- function(id, data) {
# 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.
# Because we use identical we strip the expr attribute to avoid espurious updates.
# This should not be much of a problem as no is using that expression.
# A solution to the above is that the code is returned as part of a list of two reactives,
# list (value, code). This way altering the code does not necessarily update the depending
Expand All @@ -211,7 +212,11 @@ data_filter_server <- function(id, data) {
shiny::observeEvent(
selected(),
{
if (is.null(returned()) || !identical(selected(), returned())) {
selected_no_expr <- selected()
attr(selected_no_expr, "expr") <- NULL
returned_no_expr <- returned()
attr(returned_no_expr, "expr") <- NULL
if (is.null(returned()) || !identical(selected_no_expr, returned_no_expr)) {
returned(selected())
}
}
Expand Down

0 comments on commit 6aef0d8

Please sign in to comment.