Skip to content

Commit 5e7884d

Browse files
authored
[DataTable] Fix multiselect containing commas (#9743)
When selected, multiselect filter options containing a comma would not display any data because they were being split by commas (see below). * Resolves #7531 * On aces/CCNA#7962
1 parent 0bcb31c commit 5e7884d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jsx/DataTable.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,12 @@ class DataTable extends Component {
370370
searchKey = filterData[i].toLowerCase();
371371
searchString = data ? data.toString().toLowerCase() : '';
372372

373-
let searchArray = searchString.split(',');
374-
match = (searchArray.includes(searchKey));
373+
if (searchKey.includes(',')) {
374+
match = (searchString == searchKey);
375+
} else {
376+
let searchArray = searchString.split(',');
377+
match = (searchArray.includes(searchKey));
378+
}
375379
if (match) {
376380
result = true;
377381
}

0 commit comments

Comments
 (0)