From 67ea803bd0c68194d51f94d50c7f017c80c6146d Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 17 Dec 2020 15:36:09 +0100 Subject: [PATCH] Ignore spaces in string filter when not exact --- src/app/helperFunctions/customTableFilterFunction.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/helperFunctions/customTableFilterFunction.ts b/src/app/helperFunctions/customTableFilterFunction.ts index 9d48ee8..a8a18b6 100644 --- a/src/app/helperFunctions/customTableFilterFunction.ts +++ b/src/app/helperFunctions/customTableFilterFunction.ts @@ -26,8 +26,9 @@ export function customTableFilterFunction(data: any, filter: any) { return false; } if (!filterElement.options.caseSensitive) { - searchString = searchString.toLowerCase(); - dataElement = dataElement.toLowerCase(); + searchString = searchString.toLowerCase().replace(/\s/g, ''); + dataElement = dataElement.toLowerCase().replace(/\s/g, ''); + console.log(searchString, dataElement); } if ( (filterElement.options.exact && dataElement !== searchString) ||