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

Column search returns no rows when '&' is in the search term #1075

Closed
3 tasks done
dfriend21 opened this issue Jul 12, 2023 · 5 comments
Closed
3 tasks done

Column search returns no rows when '&' is in the search term #1075

dfriend21 opened this issue Jul 12, 2023 · 5 comments
Assignees
Labels

Comments

@dfriend21
Copy link

When a column has a value with an ampersand, searching for that value returns no results.

Example:

library(shiny)
library(DT)

ui <- fluidPage(
  DT::dataTableOutput("table")
)

server <- function(session, input, output){
  output$table <- DT::renderDataTable({
    data.frame(a = factor(c("A", "B", "C&", "D")), b = 1:4)
  }, filter = "top")
}

shinyApp(ui, server)
Screenshots from the example
The table, pre-filtering:

image

After searching column 'a' for the value 'C&':

image

Output of `xfun::session_info('DT')`
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045), RStudio 2023.6.0.421


Locale:
  LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
  LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

Package version:
  base64enc_0.1.3   bslib_0.5.0       cachem_1.0.8      cli_3.6.1         crosstalk_1.2.0   digest_0.6.33    
  DT_0.28.1         ellipsis_0.3.2    evaluate_0.21     fastmap_1.1.1     fontawesome_0.5.1 fs_1.6.2         
  glue_1.6.2        graphics_4.3.1    grDevices_4.3.1   highr_0.10        htmltools_0.5.5   htmlwidgets_1.6.2
  jquerylib_0.1.4   jsonlite_1.8.7    knitr_1.43        later_1.3.1       lazyeval_0.2.2    lifecycle_1.0.3  
  magrittr_2.0.3    memoise_2.0.1     methods_4.3.1     mime_0.12         promises_1.2.0.1  R6_2.5.1         
  rappdirs_0.3.3    Rcpp_1.0.11       rlang_1.1.1       rmarkdown_2.23    sass_0.4.6        stats_4.3.1      
  stringi_1.7.12    stringr_1.5.0     tinytex_0.45      tools_4.3.1       utils_4.3.1       vctrs_0.6.3      
  xfun_0.39         yaml_2.3.7
Promises

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('DT'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/DT').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@olivier7121
Copy link

I am experiencing exactly the same issue.

Output of xfun::session_info('DT')

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045), RStudio 2023.6.1.524


Locale: LC_COLLATE=French_France.utf8  LC_CTYPE=French_France.utf8    LC_MONETARY=French_France.utf8 LC_NUMERIC=C                   LC_TIME=French_France.utf8    

time zone: Europe/Berlin
tzcode source: internal

Package version:
  base64enc_0.1.3   bslib_0.5.0       cachem_1.0.8      cli_3.6.1         crosstalk_1.2.0   digest_0.6.33     DT_0.28           ellipsis_0.3.2    evaluate_0.21    
  fastmap_1.1.1     fontawesome_0.5.1 fs_1.6.3          glue_1.6.2        graphics_4.3.1    grDevices_4.3.1   highr_0.10        htmltools_0.5.5   htmlwidgets_1.6.2
  jquerylib_0.1.4   jsonlite_1.8.7    knitr_1.43        later_1.3.1       lazyeval_0.2.2    lifecycle_1.0.3   magrittr_2.0.3    memoise_2.0.1     methods_4.3.1    
  mime_0.12         promises_1.2.0.1  R6_2.5.1          rappdirs_0.3.3    Rcpp_1.0.11       rlang_1.1.1       rmarkdown_2.23    sass_0.4.7        stats_4.3.1      
  stringi_1.7.12    stringr_1.5.0     tinytex_0.45      tools_4.3.1       utils_4.3.1       vctrs_0.6.3       xfun_0.39         yaml_2.3.7```

@yihui yihui added the bug label Aug 17, 2023
@yihui yihui self-assigned this Aug 17, 2023
@yihui yihui closed this as completed in fa31cd2 Aug 17, 2023
@yihui
Copy link
Member

yihui commented Aug 17, 2023

Should be fixed now. Thanks for the report!

@prubin73
Copy link

FYI, I ran into this with an ampersand in a factor. The latest version (0.28.3) fixes it when using the column filter, but if I type an ampersand in the table search box (upper right) it still fails.

@yihui
Copy link
Member

yihui commented Aug 28, 2023

@prubin73 Thanks so much! I just pushed another fix.

@prubin73
Copy link

Wow, that was fast! Just confirmed that it works for me. Thanks!

AhmedKhaled945 pushed a commit to AhmedKhaled945/DT that referenced this issue Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants