Skip to content

[Bug]: output is not updated when filter is addedΒ #870

@donyunardi

Description

@donyunardi

What happened?

tm_t_crosstable output is not updated when filter is applied:
https://insightsengineering.github.io/teal.modules.general/latest-tag/reference/tm_t_crosstable.html#examples-in-shinylive

Image

Upon investigation, I believe this is because of this line:
https://github.com/insightsengineering/teal.modules.general/blob/main/R/tm_t_crosstable.R#L318

The qenv object created with this line is not a reactive object so only got evaluated once even though data() changes.
Once I made this into a reactive object, the module works as expected:

Image

The update code for that line:

    qenv <- reactive({
      teal.code::eval_code(data(), 'library("rtables");library("tern");library("dplyr")') # nolint quotes
    })

    anl_merged_q <- reactive({
      req(anl_merged_input())
      qenv() %>%
        teal.code::eval_code(as.expression(anl_merged_input()$expr))
    })

The PR related to this changes is:
#847

We need to double check again all modules, fix, and do a patch release.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions