mirror of
https://github.com/pheralb/svgl.git
synced 2024-12-05 05:42:35 +08:00
Merge pull request #429 from Jared-MB/main
⚙️ Listen to search params to clear results
This commit is contained in:
commit
1ae2e81836
@ -1,4 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { page } from '$app/stores';
|
||||||
import { inputStyles } from '@/ui/styles';
|
import { inputStyles } from '@/ui/styles';
|
||||||
import { Command, SearchIcon } from 'lucide-svelte';
|
import { Command, SearchIcon } from 'lucide-svelte';
|
||||||
export let searchTerm: string;
|
export let searchTerm: string;
|
||||||
@ -24,6 +25,17 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let searchParams = {} as { [key: string]: string };
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if ($page) {
|
||||||
|
searchParams = Object.fromEntries($page.url.searchParams);
|
||||||
|
if (!searchParams?.search) {
|
||||||
|
clearSearch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="sticky top-[63px] z-50">
|
<div class="sticky top-[63px] z-50">
|
||||||
|
Loading…
Reference in New Issue
Block a user