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

Update 158-input-labels to leverage HTML labels #262

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions inst/apps/158-input-labels/app.R
Expand Up @@ -9,7 +9,7 @@ row <- function(w1, w2) {
fluidRow(column2(w1), column2(w2))
}

label_initial <- "An <i>escaped</i> Label"
label_initial <- HTML("An <i>escaped</i> Label")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label_initial <- HTML("An <i>escaped</i> Label")
label_initial <- HTML("An <i>html</i> Label")


ui <- fluidPage(
p("Everytime you click on the button below, it should add labels to the column that doesn't (currently) have labels, and remove labels from the column that does (currently) have labels. Every label should say: '", tags$b(label_initial, .noWS = "outside"), "'."),
Expand Down Expand Up @@ -135,7 +135,7 @@ server <- function(input, output, session) {
shinyjster::shinyjster_server(input, output, session)

observeEvent(input$update, {
label1 <- if (isTRUE(input$update %% 2 == 0)) character(0) else "An <i>escaped</i> Label"
label1 <- if (isTRUE(input$update %% 2 == 0)) character(0) else HTML("An <i>escaped</i> Label")
updateTextInput(session, "textInput1", label = label1)
updateTextAreaInput(session, "textAreaInput1", label = label1)
updateNumericInput(session, "numericInput1", label = label1)
Expand All @@ -149,7 +149,7 @@ server <- function(input, output, session) {
updateCheckboxGroupInput(session, "checkboxGroupInput1", label = label1)
updateDateInput(session, "dateInput1", label = label1)

label2 <- if (isTRUE(input$update %% 2 > 0)) character(0) else "An <i>escaped</i> Label"
label2 <- if (isTRUE(input$update %% 2 > 0)) character(0) else HTML("An <i>escaped</i> Label")
updateTextInput(session, "textInput2", label = label2)
updateTextAreaInput(session, "textAreaInput2", label = label2)
updateNumericInput(session, "numericInput2", label = label2)
Expand Down