Skip to content

Commit 37fb509

Browse files
committed
fix:broken filter
1 parent 7ce18be commit 37fb509

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

src/lib/components/filters/content.svelte

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
InputSelectCheckbox,
99
InputDateTime
1010
} from '$lib/elements/forms';
11-
import { createEventDispatcher, onMount } from 'svelte';
12-
import { operators, addFilter, queries, type TagValue } from './store';
11+
import { onMount } from 'svelte';
12+
import { operators, addFilter, queries, tags } from './store';
1313
import type { Column } from '$lib/helpers/types';
1414
import type { Writable } from 'svelte/store';
1515
import { TagList } from '.';
@@ -35,15 +35,8 @@
3535
}));
3636
3737
$: operator = operatorKey ? operators[operatorKey] : null;
38-
$: {
39-
columnId;
40-
operatorKey = null;
41-
}
42-
4338
$: isDisabled = !operator;
4439
45-
let localTags: TagValue[] = [];
46-
4740
onMount(() => {
4841
value = column?.array ? [] : null;
4942
if (column?.type === 'datetime') {
@@ -62,12 +55,6 @@
6255
queries.apply();
6356
}
6457
}
65-
66-
const dispatch = createEventDispatcher<{
67-
clear: void;
68-
apply: { applied: number };
69-
}>();
70-
dispatch('apply', { applied: localTags.length });
7158
</script>
7259

7360
<div>
@@ -151,10 +138,10 @@
151138
{/if}
152139
</form>
153140

154-
{#if !singleCondition}
141+
{#if !singleCondition && $tags.length > 0}
155142
<ul class="u-flex u-flex-wrap u-cross-center u-gap-8 u-margin-block-start-16 tags">
156143
<TagList
157-
tags={localTags}
144+
tags={$tags}
158145
on:remove={(e) => {
159146
queries.removeFilter(e.detail);
160147
queries.apply();

0 commit comments

Comments
 (0)