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

Output of virtualSelectInput does not handle special characters properly #710

Closed
joeramirez opened this issue Oct 11, 2024 · 2 comments
Closed

Comments

@joeramirez
Copy link

joeramirez commented Oct 11, 2024

I believe this is a similar/same issue as #6 , but when the virtualSelectInput choices contain items with special characters ('&' for example), the resulting output when those items are selected come out with URL encoding (ie, '&).

shinyWidgets package version: 0.8.7
shiny package version: 1.9.1
R version: 4.4.1

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  sidebarLayout(
    sidebarPanel(
      virtualSelectInput(
        inputId = "test",
        label = "Test",
        choices = c("Oranges", "Berries", "Peaches & Plums", "Apples & Bananas"),
        multiple = T
      )
    ),
    mainPanel(
        textOutput("myOutput"),
      )
  )
)

server <- function(input, output) {

  output$myOutput <- renderText({
    paste0(input$test, collapse = " | ")
  })
}

shinyApp(ui = ui, server = server)
@pvictor
Copy link
Member

pvictor commented Oct 16, 2024

Hello,
You have to use html = TRUE otherwise special characters in HTML are escaped.

Victor

@joeramirez
Copy link
Author

Of course!! Sorry - didn't see that option somehow. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants