Skip to content

Commit 276c891

Browse files
committed
Update 158-input-labels to leverage HTML labels
1 parent 71f027e commit 276c891

File tree

1 file changed

+3
-3
lines changed
  • inst/apps/158-input-labels

1 file changed

+3
-3
lines changed

inst/apps/158-input-labels/app.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ row <- function(w1, w2) {
99
fluidRow(column2(w1), column2(w2))
1010
}
1111

12-
label_initial <- "An <i>escaped</i> Label"
12+
label_initial <- HTML("An <i>escaped</i> Label")
1313

1414
ui <- fluidPage(
1515
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"), "'."),
@@ -135,7 +135,7 @@ server <- function(input, output, session) {
135135
shinyjster::shinyjster_server(input, output, session)
136136

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

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

0 commit comments

Comments
 (0)