Skip to content

Commit

Permalink
reactive questions can now show asterisks if they are required
Browse files Browse the repository at this point in the history
  • Loading branch information
pingfan-hu committed Oct 5, 2024
1 parent cd50749 commit dbbe64e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
11 changes: 4 additions & 7 deletions R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,9 @@ sd_question <- function(
id = paste0("container-", id),
`data-question-id` = id,
class = "question-container",
style = sprintf("width: %s; position: relative;", width),
style = sprintf("width: %s;", width),
oninput = js_interaction,
if (type == "matrix") {
output
} else {
shiny::div(output)
}
output
)

if (!is.null(shiny::getDefaultReactiveDomain())) {
Expand Down Expand Up @@ -869,7 +865,8 @@ sd_output <- function(id, type = NULL, display = "inline", wrapper = NULL, ...)
id = paste0("placeholder-", id),
`data-question-id` = id,
class = "question-container",
shiny::uiOutput(id)
shiny::uiOutput(id),
shiny::tags$span(class = "hidden-asterisk", "*")
))
}

Expand Down
1 change: 1 addition & 0 deletions inst/css/surveydown.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ p, .form-group, .control-label {
margin-left: auto;
margin-right: auto;
margin-bottom: 1rem;
position: relative;
}

.shiny-input-container:not(.shiny-input-container-inline) {
Expand Down

0 comments on commit dbbe64e

Please sign in to comment.