Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
bugfix: fix filter not work when value is 0 (number) (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
ousing9 authored and chenshuai2144 committed Dec 24, 2019
1 parent 7867636 commit df0815e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,11 @@ const genColumnList = <T, U = {}>(
const config = map[columnKey] || { fixed: item.fixed };
return {
onFilter: (value: string, record: T) => {
const itemValue = String(record[item.dataIndex || ''] || '') as string;
let recordElement = record[item.dataIndex || ''];
if (typeof recordElement === 'number') {
recordElement = recordElement.toString();
}
const itemValue = String(recordElement || '') as string;
return String(itemValue) === String(value);
},
index: columnsIndex,
Expand Down

0 comments on commit df0815e

Please sign in to comment.