Skip to content

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

@olivier7121

Description

@olivier7121

First, thank you very much for this fantastic package.

The issue I'm reporting is related to this one: #1075

When entries contain the character '&', they are now 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions