From 3f97ecb9944a465ab9cede97bb437b878bb942d4 Mon Sep 17 00:00:00 2001 From: Benjamin Cavy Date: Tue, 23 Apr 2024 15:01:58 +0200 Subject: [PATCH] fix: crash on discrete multi select column filter Fix #810 --- izanami-frontend/src/components/GenericTable.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/izanami-frontend/src/components/GenericTable.tsx b/izanami-frontend/src/components/GenericTable.tsx index 728f1612b..3f1baee72 100644 --- a/izanami-frontend/src/components/GenericTable.tsx +++ b/izanami-frontend/src/components/GenericTable.tsx @@ -444,7 +444,11 @@ function Filter({ column }: { column: Column; table: Table }) { options={options} onChange={(e) => { const values = e.map(({ value }) => value); - column.setFilterValue(values); + if (values.length === 0) { + column.setFilterValue(undefined); + } else { + column.setFilterValue(values); + } }} isMulti />