Skip to content

Commit

Permalink
avoid refresh loop #20
Browse files Browse the repository at this point in the history
  • Loading branch information
shahronak47 committed Apr 2, 2023
1 parent 7c94767 commit 7055c81
Showing 1 changed file with 12 additions and 28 deletions.
40 changes: 12 additions & 28 deletions R/mod_infrasap_tab_module.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,34 +165,18 @@ mod_infrasap_tab_module_server <- function(id){
output$countriestc <- shiny::renderUI({
shiny::req(countriesOptionsInput())
countryList <- country_to_compare_list(infrasap_dat_mod_modified, input$db_sector, input$db_pillar)

if(is.null(selected_vals$db_countries_name)) {
shiny::selectizeInput(inputId = ns('country_to_compare_id'),
label = 'Countries to compare to',
choices = sort(unique(countryList)),
selected = countriesOptionsInput(),
multiple = TRUE,
options = list(
maxItems = 3,
'plugins' = list('remove_button'),
'create' = TRUE,
'persist' = FALSE
)
)
} else {
shiny::selectizeInput(inputId = ns('country_to_compare_id'),
label = 'Countries to compare to',
choices = sort(unique(countryList)),
selected = selected_vals$db_countries_name,
multiple = TRUE,
options = list(
maxItems = 3,
'plugins' = list('remove_button'),
'create' = TRUE,
'persist' = FALSE
)
)
}
shiny::selectizeInput(inputId = ns('country_to_compare_id'),
label = 'Countries to compare to',
choices = sort(unique(countryList)),
selected = countriesOptionsInput(),
multiple = TRUE,
options = list(
maxItems = 3,
'plugins' = list('remove_button'),
'create' = TRUE,
'persist' = FALSE
)
)
})


Expand Down

0 comments on commit 7055c81

Please sign in to comment.