Skip to content

Commit

Permalink
fix #244
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten König committed Jul 23, 2024
1 parent 6d451da commit 4c68dd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.0.10

* fix table column size regression introduced in `1.0.9`, fixes [#245](https://github.com/cars10/elasticvue/issues/245)
* fix filtering when `null` values are present, fixes [#244](https://github.com/cars10/elasticvue/issues/244)

## 1.0.9

Expand Down
4 changes: 2 additions & 2 deletions src/helpers/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export function filterItems<T extends Filterable> (items: T[], searchQuery: stri
if (column.trim() === '') return items

return items.filter(item => {
if (Object.hasOwnProperty.bind(item)(column)) {
if (Object.hasOwnProperty.bind(item)(column) && item[column] !== null) {
return item[column].toString().toLowerCase().includes(query)
}
})
} else {
return items.filter(item => {
return headerNames.some(headerName => {
if (Object.hasOwnProperty.bind(item)(headerName)) {
if (Object.hasOwnProperty.bind(item)(headerName) && item[headerName] !== null) {
return item[headerName].toString().toLowerCase().includes(search)
}
})
Expand Down

0 comments on commit 4c68dd6

Please sign in to comment.