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

HTML special characters in choices of pickerInput when using choicesOpt #682

Open
bdbmax opened this issue Mar 28, 2024 · 0 comments
Open

Comments

@bdbmax
Copy link

bdbmax commented Mar 28, 2024

The display of apostrophes (and &, >, <, ", ...) is not rendered correctly in the choices when using pickerInput with choicesOpt. It appears that the labels specified in the choices list are being escaped to their HTML entities.

image

This does not happen when choicesOpt is set to NULL. It seems like it is happening because of the htmltools::htmlEscape call with attribute = TRUE within the internal function pickerSelectOptions, called by pickerInput.

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  pickerInput(
    inputId = "my_picker",
    choices = list("Option's" = c("Option'1", "Option'2")),
    choicesOpt = list(disabled = c(TRUE, FALSE))
  )
)

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

shinyApp(ui = ui, server = server)
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

1 participant