Skip to content

Commit 4bfacab

Browse files
authored
Merge pull request #1399 from fedspendingtransparency/FDG-9594-Add-Month-and-year-Filters
FDG-9594 Fix text filtering
2 parents 1946192 + 897b04a commit 4bfacab

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/components/combo-select/combo-currency-select/combo-select-dropdown/combo-select-dropdown.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,23 @@ const ComboSelectDropdown = ({
4343
const filterOptionsByEntry = (opts, entry) => {
4444
let filteredList = [];
4545
if (entry?.length && !hasChildren) {
46-
filteredList = opts.filter(opt => opt[optionLabelKey].toUpperCase().includes(entry.toUpperCase()));
46+
filteredList = opts.filter(opt =>
47+
opt[optionLabelKey]
48+
.toString()
49+
.toUpperCase()
50+
.includes(entry.toUpperCase())
51+
);
4752
setNoResults(filteredList.length === 0);
4853
} else if (hasChildren) {
4954
let sectionResults;
5055
let allResultsLength = 0;
5156
opts.forEach(section => {
52-
sectionResults = section.children.filter(opt => opt[optionLabelKey].toUpperCase().includes(entry.toUpperCase()));
57+
sectionResults = section.children.filter(opt =>
58+
opt[optionLabelKey]
59+
.toString()
60+
.toUpperCase()
61+
.includes(entry.toUpperCase())
62+
);
5363
allResultsLength += sectionResults.length;
5464
filteredList.push({ label: section.label, children: sectionResults });
5565
});

0 commit comments

Comments
 (0)