Skip to content

Ampersands ("&") in selected group values break filter_checkbox #167

@Dylan-W-Lewis

Description

@Dylan-W-Lewis

Checkbox filtering does not work when a value containing an ampersand is selected.

Probably related to #87, but the ampersand doesn't appear to be double-escaped, as was the issue with filter_select.

I'm using crosstalk 1.2.2 with R 4.5.1

Reproducible example (.rmd):

---
title: "Crosstalk checkbox ampersand example"
output: html_document
---
  
```{r setup, include=FALSE}
library(crosstalk)
library(DT)

my_data <- mtcars
my_data$colour <- rep(c("Red", "Green", "White & Gold", "Black & Blue"), times = 8)

shared_data <- SharedData$new(my_data)

```

```{r, echo=FALSE}
filter_checkbox("colour", 
                "Choose colour", 
                shared_data, 
                ~colour)
```

## Data

```{r, echo=FALSE}
shared_data |>
  datatable()
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions