From cb8564f73eab62af6715aec2b4c936dd349278bd Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 19 Apr 2024 12:53:23 +0100 Subject: [PATCH] Clear the onEmptyFilter from datasource filtering when no fields are specified --- packages/frontend-core/src/components/FilterBuilder.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/frontend-core/src/components/FilterBuilder.svelte b/packages/frontend-core/src/components/FilterBuilder.svelte index 1b252d5b06..b90882449f 100644 --- a/packages/frontend-core/src/components/FilterBuilder.svelte +++ b/packages/frontend-core/src/components/FilterBuilder.svelte @@ -67,6 +67,12 @@ const removeFilter = id => { filters = filters.filter(field => field.id !== id) + + // Clear all filters when no fields are specified + let [first] = filters + if (filters.length == 1 && first?.onEmptyFilter) { + filters = [] + } } const duplicateFilter = id => {