Skip to content

Commit

Permalink
patch bug - show_if on reactive questions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed Sep 24, 2024
1 parent f2f8004 commit 295d865
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,10 @@ extract_html_pages <- function(
if (!is.null(show_if)) {
if (question_id %in% show_if$targets) {
current_style <- xml2::xml_attr(container, "style")
current_style <- if (is.na(current_style)) "" else current_style
new_style <- paste(current_style, "display: none;", sep = " ")
new_style <- gsub("display:\\s*block;", "display: none;", current_style, ignore.case = TRUE)
xml2::xml_attr(container, "style") <- new_style
}
}

question_containers[[i]] <- container
}

Expand Down
2 changes: 1 addition & 1 deletion R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ sd_output <- function(id, type = NULL, display = "inline", wrapper = NULL, ...)
return(shiny::div(
id = paste0("placeholder-", id),
`data-question-id` = id,
class = "question-container reactive-question-placeholder",
class = "question-container",
shiny::uiOutput(id)
))
}
Expand Down

0 comments on commit 295d865

Please sign in to comment.