Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
ExpandableTable include title in searchable content
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiggr committed May 12, 2022
1 parent d45dd91 commit 49e98af
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ const View = (props) => {
return;
}
const re = new RegExp(_.escapeRegExp(data.value), 'i');

const searchableCols =
props.data && props.data.popupTitle
? [...selectedColumns, { column: props.data.popupTitle }]
: selectedColumns;

const isMatch = (result) => {
for (let colDef of selectedColumns) {
for (let colDef of searchableCols) {
if (re.test(result[colDef.column])) {
return true;
}
Expand All @@ -92,7 +98,7 @@ const View = (props) => {
}, time);
},
/* eslint-disable-next-line */
[filteredTableData, selectedColumns],
[filteredTableData, selectedColumns, data.popupTitle],
);

React.useEffect(() => {
Expand Down

0 comments on commit 49e98af

Please sign in to comment.