From b75eb53f67b41a776e20441e583bb5adf0e059ad Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Mon, 14 Dec 2020 15:53:38 +0100 Subject: [PATCH] Fix list filter --- src/app/helperFunctions/customTableFilterFunction.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/helperFunctions/customTableFilterFunction.ts b/src/app/helperFunctions/customTableFilterFunction.ts index 8cd429c..9d48ee8 100644 --- a/src/app/helperFunctions/customTableFilterFunction.ts +++ b/src/app/helperFunctions/customTableFilterFunction.ts @@ -10,11 +10,9 @@ export function customTableFilterFunction(data: any, filter: any) { // List Filter - ignore types if column is list if (filterElement.list && filterElement.values?.length > 0) { let dataElement: Array = data[filterElementName]; - if (dataElement.length !== filterElement.values.length) { - return false; - } - for (const element of filterElement.values) { - if (!dataElement.includes(element)) { + for (const filterValue of filterElement.values) { + const searchSring = filterValue.trim().toLowerCase(); + if (!dataElement.map(element => element.trim().toLowerCase()).includes(searchSring)) { return false; } }