Skip to content

Commit

Permalink
fix(filter): null pointer issue when matching data with fuzzy filter
Browse files Browse the repository at this point in the history
  • Loading branch information
fobbyal committed Dec 28, 2018
1 parent 9eb5108 commit ebdc8ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ const computeSortOptions = (sortOptions, { ident, display }) => {
}

const matchData = (rowData, fuzzyFilter) => header =>
extractAndFormatData({ rowData, header })
.toLowerCase()
.includes(fuzzyFilter.toLowerCase())
fromNullable(extractAndFormatData({ rowData, header }))
.map(txt => txt.toLowerCase().includes(fuzzyFilter.toLowerCase()))
.getOrElse()

const filterData = (data, headers, fuzzyFilter) => {
const filteredHeaders = R.filter(({ isKey, isFiltered }) => isKey || isFiltered, headers)
Expand Down

0 comments on commit ebdc8ec

Please sign in to comment.