Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Selector Initialization Issue When Invoked from Another Module #3

Merged
merged 10 commits into from
Aug 13, 2024
5 changes: 5 additions & 0 deletions R/dressing_room.R
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,13 @@ app_creator_feedback_server <- function(id, warning_messages, error_messages, ui
if (length(error_messages()) == 0) res <- append(res, list(ui))
return(res)
})

# See: (ag4hj)
shiny::outputOptions(output, "ui", suspendWhenHidden = FALSE)
}
)



return(module)
}
9 changes: 9 additions & 0 deletions R/mod_patient_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ mod_patient_profile_server <- function(id, subject_level_dataset, extra_datasets
return(res)
})

# (ag4hj): Without these outputOptions the update selector (See: ag4hj) tries to update a selector that is not yet
# in the UI. Therefore the update is lost. In practice this means that when using the receiver_ids the first
# subjid is lost and the interaction is incorrect.
shiny::outputOptions(output, "ui", suspendWhenHidden = FALSE)

output[["selector"]] <- shiny::renderUI({
subject_level_dataset <- subject_level_dataset()
shiny::req(subject_level_dataset, cancelOutput = TRUE)
Expand All @@ -98,6 +103,10 @@ mod_patient_profile_server <- function(id, subject_level_dataset, extra_datasets
)
})

# See: (ag4hj)
shiny::outputOptions(output, "selector", suspendWhenHidden = FALSE)

# See: (ag4hj)
# change selected patient based on sender_ids
if (!is.null(sender_ids)) {
lapply(sender_ids, function(x) {
Expand Down