mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

search caseSensitive not displaying results

Open allenjoy123 opened this issue 8 years ago • 3 comments

Expected Behavior

When the caseSensitive option is set to true, the search results should display if there is an exact case match between search text and full or partial column value when the case is mixed or Upper case.

Current Behavior

However when the caseSensitive Option is set to true, the search results display no results when there is a valid case match between search text and column value (full or partial value with non-lower case). (I checked the code and notice a possible issue at line 360 of MuiDatatable.js , the search text is always changed to lower case when searching the searchCase.)

Relevant code in MuiDatatable.js (for bugs)

  const searchCase = !this.options.caseSensitive ? columnVal.toLowerCase() : columnVal.toString();

  if (searchText && searchCase.indexOf(searchText.toLowerCase()) >= 0) {
    isSearchFound = true;
  }

allenjoy123 avatar Sep 05 '18 12:09 allenjoy123

Thanks for filing this issue and good catch. Would you like to send in a PR?

gregnb avatar Sep 05 '18 13:09 gregnb

Took care of this one. Should be released sometime later tonight

gregnb avatar Sep 07 '18 08:09 gregnb

This should be solved in the latest version

gregnb avatar Sep 07 '18 08:09 gregnb