ITADN
rstudio/DT/Issues

Impossible to remove items/entries containing '&' from the filter

#1169Openolivier7121 创建于 2025-04-12
O
olivier7121commented
First, thank you very much for this fantastic package. The issue I'm reporting is related to this one: https://github.com/rstudio/DT/issues/1075 When entries contain the character '&', they are properly filtered but they cannot be removed from the filter/search bar. Other entries not containing this character can be filtered and removed/deleted without any problem. I copy below a minimum reproducible example: it appears the issue is somehow connected to `selectize` as when an input is used within the same Shiny app with `selectize` set to `TRUE`, the issue occurs; when set to `FALSE` everything works as intended. ``` library("DT") library("shiny") MyInputChoices <- c("A & A", "B & B", "C & C", "D & D", "A - A", "B - B", "C - C", "D - D") MyDataFrame <- data.frame(DF.column = as.factor(c("A & B", "B & C", "C & D", "D & E", "A - B", "B - C", "C - D", "D - E"))) ui <- fluidPage( fluidRow( selectInput(inputId = "MyInput.ID", label = "MyInput.Label", choices = MyInputChoices, selected = c("D & D"), multiple = FALSE, selectize = TRUE), DT::dataTableOutput("MyTable") ) ) server <- function(session, input, output){ output$MyTable <- DT::renderDataTable({ datatable(MyDataFrame, rownames = FALSE, escape = TRUE, filter = 'top', selection = 'none', options = list( dom = 'tp', ordering = F, autoWidth = TRUE ) ) }, server = TRUE) MyTable_proxy <- DT::dataTableProxy("MyTable") } shinyApp(ui, server) ```
0 条评论