diff --git a/samples/react-datatable/README.md b/samples/react-datatable/README.md index d5698be43..f08522677 100644 --- a/samples/react-datatable/README.md +++ b/samples/react-datatable/README.md @@ -41,7 +41,7 @@ Version|Date|Comments -------|----|-------- 1.0|February 19, 2021|Initial release 1.1|February 24, 2021|Added support for large lists - +1.2|March 01, 2021|Fixed search issue for number field ## Disclaimer **THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** diff --git a/samples/react-datatable/package-lock.json b/samples/react-datatable/package-lock.json index d0f8761b6..659ad87b1 100644 --- a/samples/react-datatable/package-lock.json +++ b/samples/react-datatable/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-datatable", - "version": "0.0.1", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/samples/react-datatable/src/webparts/reactDatatable/components/ReactDatatable.tsx b/samples/react-datatable/src/webparts/reactDatatable/components/ReactDatatable.tsx index 4068b9682..6a144264e 100644 --- a/samples/react-datatable/src/webparts/reactDatatable/components/ReactDatatable.tsx +++ b/samples/react-datatable/src/webparts/reactDatatable/components/ReactDatatable.tsx @@ -143,8 +143,8 @@ export default class ReactDatatable extends React.Component searchBy.some(field => { - return (l[field] && l[field].toLowerCase().includes(searchText.toLowerCase())); + listItems = listItems && listItems.length && listItems.filter(l => searchBy.some(field => { + return (l[field] && l[field].toString().toLowerCase().includes(searchText.toLowerCase())); })); } }