-
Notifications
You must be signed in to change notification settings - Fork 158
Open
Description
I have a form that has choices that include an ampersand, &. Even when I try to wrap the label in HTML(), it sometimes shows as &. Here's some screenshots and code that shows the bug.
While testing this, I also noticed related additional unexpected behavior: the selection chip is being rendered from the label = argument of prepare_slim_choices(), and not the html = argument. You can test this by replacing label = name with label = seq_along(name) and the dropdown will show "Apples & Bananas" but the chip will show "1".
None of the selection chips work

library(shiny)
library(shinyWidgets)
dat = data.frame(name = "Apples & Bananas", value = "apples_bananas")
ui <- fluidPage(
slimSelectInput(
"input1",
label = "Label only (wrong in dropdown and chip)",
choices = prepare_slim_choices(
dat,
label = name,
value = value
),
multiple = T
),
slimSelectInput(
"input2",
label = "With HTML (correct in dropdown, wrong in chip)",
choices = prepare_slim_choices(
dat,
label = name,
value = value,
html = purrr::map(name, HTML)
),
multiple = T
),
slimSelectInput(
"input3",
label = "With HTML and marking label as HTML (correct in dropdown, wrong in chip)",
choices = prepare_slim_choices(
dat,
label = purrr::map(name, HTML),
value = value,
html = purrr::map(name, HTML)
),
multiple = T
),
)
server <- function(input, output, session) {
}
shinyApp(ui, server)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

