dreamRs / shinyWidgets

shinyWidgets : Extend widgets available in shiny
https://dreamrs.github.io/shinyWidgets/
GNU General Public License v3.0
833 stars 153 forks source link

Bug: Special characters in virtualSelectInput #696

Closed JerePlum99 closed 5 months ago

JerePlum99 commented 6 months ago

Appreciate all the work being done here! Similar to #6 it appears that special characters, at least "&" is rendering incorrectly within the virtualSelectInput - likely due to an HTML escaping issue.

Let me know if you need anything else!

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  tags$h2("Virtual Select"),

  fluidRow(
    column(
      width = 4,
      virtualSelectInput(
        inputId = "multiple",
        label = "Multiple select:",
        choices = c("Example & Error", "Normal Behavior"),
        multiple = TRUE
      )
    ),
    column(
      width = 4,

      tags$b("Multiple select :"),
      verbatimTextOutput("res_multiple"),
      tags$b("Is virtual select open ?"),
      verbatimTextOutput(outputId = "res_multiple_open"),
    )
  )

)

server <- function(input, output, session) {

  output$res_multiple <- renderPrint(input$multiple)
  output$res_multiple_open <- renderPrint(input$multiple_open)

}

shinyApp(ui = ui, server = server)
pvictor commented 6 months ago

I think you can use html = TRUE for fixing the problem.

JerePlum99 commented 5 months ago

@pvictor Ahhh you are correct, my oversight. Thank you!