shiny icon indicating copy to clipboard operation
shiny copied to clipboard

HTML line break in label does not work for updateNumericInput

Open Gutschlhofer opened this issue 2 years ago • 0 comments

System details

Output of sessionInfo():

shiny_1.7.1    

Example application

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(
  
  shiny::numericInput("testinput", label = HTML("line<br>break works"), value = 1, min = 1, max = 2)
  
)

# Define server logic required to draw a histogram
server <- function(session, input, output) {
  
  updateNumericInput(session, "testinput", label = HTML("line<br>break broke"))
  
}

# Run the application 
shinyApp(ui = ui, server = server)

Describe the problem in detail

When updating a label of a numericInput, the updated label does not seem to work with HTML code and just prints it out "as is". So instead of a line break I get the <br> printed out. However, it works on the original label before it's updated. If I use \n instead of <br> it's just omitted from the output and no line break appears either.

Gutschlhofer avatar Aug 01 '22 13:08 Gutschlhofer