From fda05d200e288aa18b6a7663ef2f86bab4b8e6bd Mon Sep 17 00:00:00 2001 From: Peter Bui Date: Tue, 25 Jul 2023 17:09:05 -0400 Subject: [PATCH] fix: add onchange for Communities TextInput This allows the user to simply enter in their filter and press enter, rather than having to press the "Search" button. --- src/lib/components/input/TextInput.svelte | 1 + src/routes/communities/+page.svelte | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/components/input/TextInput.svelte b/src/lib/components/input/TextInput.svelte index 7609ee5f..c45e40e3 100644 --- a/src/lib/components/input/TextInput.svelte +++ b/src/lib/components/input/TextInput.svelte @@ -38,6 +38,7 @@ bind:value on:keydown={(e) => dispatcher('keydown', e)} on:input={(e) => dispatcher('input', e)} + on:change={(e) => dispatcher('change', e)} {...$$restProps} class={className} {required} diff --git a/src/routes/communities/+page.svelte b/src/routes/communities/+page.svelte index 3b0c6f2a..dc2b6625 100644 --- a/src/routes/communities/+page.svelte +++ b/src/routes/communities/+page.svelte @@ -37,7 +37,14 @@ }} />
- + { + $page.url.searchParams.set('q', search) + goto($page.url.toString(), { + invalidateAll: true, + }) + }} + />