mui-datatables
mui-datatables copied to clipboard
Search does not find values in columns when they are not visible
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)
- Go to the sandbox demo and type in "Business Analyst". You will see results show up.
- Uncheck "Title" from the columns filter, and notice the results remain.
- Clear the search, but leave "Title" unchecked.
- 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 |
workaround is to use customSearch. here is a sandbox https://codesandbox.io/s/muidatatables-custom-toolbar-forked-n79xpw