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

Search does not find values in columns when they are not visible

Open kpervin opened this issue 4 years ago • 1 comments

Search does not find values when they are not visible. This is working fine in v2.15.0, so this is expected functionality of the package that has been lost since v3.7.7.

Expected Behavior

When searching on a table, if a column is set to either display: false | "excluded", the result should still pop up as it is still a column in the table.

Current Behavior

If a column is set as not visible, either via the Filter Options UI, or by setting display: false | "excluded", then the value in the row is not found. However, if it is set as not visible AFTER a search is performed, the results remain. The bug only presents itself if at the beginning of the search the column is not visible.

Steps to Reproduce (for bugs)

  1. Go to the sandbox demo and type in "Business Analyst". You will see results show up.
  2. Uncheck "Title" from the columns filter, and notice the results remain.
  3. Clear the search, but leave "Title" unchecked.
  4. Search for "Business Analyst" once again, and notice no results pop up.

Your Environment

Tech Version
Material-UI 4.11.2
MUI-datatables 3.7.7
React 16.9.0
browser Chrome 92.0.4515.107

kpervin avatar Jul 30 '21 18:07 kpervin

workaround is to use customSearch. here is a sandbox https://codesandbox.io/s/muidatatables-custom-toolbar-forked-n79xpw

MrRainesE avatar Jun 07 '22 14:06 MrRainesE