DataTables / DataTablesSrc

DataTables source repository
https://datatables.net
MIT License
628 stars 423 forks source link

[BUG] Filter does not work properly when entering double quotation marks (`"`) #229

Open radmorecameron opened 1 year ago

radmorecameron commented 1 year ago

ISSUE COPIED FROM https://github.com/wet-boew/wet-boew/issues/9497

Describe the bug When trying to filter using quotation marks, the table does not get properly filtered.

To Reproduce Steps to reproduce the behavior:

  1. Go to datatables.net example table
  2. Type quotation marks " into the filter textbox
  3. See error, table won't change until 4 double quotations are entered

image

Expected behavior Rows should disappear when they don't have quotation marks.

Additional information (optional)

Adding a fourth quotation mark will get it to behave as if there was one quotation mark (hard to show as none of the rows in the example here had quotation marks) image

Desktop/Smartphone (please complete the following information)

AllanJard commented 1 year ago

Thank you for the report - agreed, there is something wrong in the handling of the quotes for an exact match string. I'll look into that for the next release.

wewhite commented 1 year ago

"this is a limitation of smart searching due to the use of double quotes to do an exact match. Unfortunately the only way around that is to disable the smart search." https://datatables.net/forums/discussion/26785/search-filter-with-a-double-quote-in-the-string#Comment_73006

AllanJard commented 1 year ago

That is the case for a single double quote yes. But I'm not convinced that the behaviour you are seeing for four double quotes is correct. That said - it will be fairly nuanced due to the exact matching from the double quotes.

francescodisciascio commented 1 year ago

A similar issue happens with comma and slash: if you put a comma or a slash in the filter textbox, data does not change. A second comma or slash is needed to see the data changing.