diff --git a/src/lib/components/filters/content.svelte b/src/lib/components/filters/content.svelte index 9fde006b6..72634ab94 100644 --- a/src/lib/components/filters/content.svelte +++ b/src/lib/components/filters/content.svelte @@ -10,7 +10,7 @@ InputDateTime } from '$lib/elements/forms'; import { createEventDispatcher, onMount } from 'svelte'; - import { tags, operators, addFilter } from './store'; + import { tags, operators, addFilter, queries } from './store'; import type { Column } from '$lib/helpers/types'; import type { Writable } from 'svelte/store'; import { TagList } from '.'; @@ -55,6 +55,9 @@ operatorKey = null; value = null; arrayValues = []; + if (singleCondition) { + queries.apply(); + } } const dispatch = createEventDispatcher<{ diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 5c4b193f6..1960a6ea9 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -50,6 +50,18 @@ queries.apply(); } + function afterApply( + e: CustomEvent<{ + applied: number; + }> + ) { + applied = e.detail.applied; + if (singleCondition) { + showFiltersDesktop = false; + showFiltersMobile = false; + } + } + $: if (!showFiltersDesktop && !showFiltersMobile) { selectedColumn = null; value = null; @@ -92,7 +104,7 @@ bind:arrayValues {columns} {singleCondition} - on:apply={(e) => (applied = e.detail.applied)} + on:apply={afterApply} on:clear={() => (applied = 0)} />
@@ -136,7 +148,7 @@ bind:value bind:arrayValues {singleCondition} - on:apply={(e) => (applied = e.detail.applied)} + on:apply={afterApply} on:clear={() => (applied = 0)} /> {#if singleCondition}