fix: hide searchbox and bump to v0.0.25

This commit is contained in:
neil molina 2023-04-06 15:29:00 +08:00
parent 4b2e303f71
commit 81745c2084
4 changed files with 6 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
"name": "tea",
"version": "0.0.24",
"version": "0.0.25",
"private": true,
"description": "tea gui app",
"author": "tea.xyz",

View file

@ -46,7 +46,7 @@
searchStore.searching.set(false);
};
</script>
{#if $searching}
{#if $searching === true}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div id="bg-close" class="z-40" on:click={onClose}></div>
<section class="z-50">
@ -55,6 +55,7 @@
<SearchInput
class="w-full rounded-sm h-9"
size="small"
autofocus={true}
placeholder={`${$t("store-search-placeholder")}`}
onSearch={(search) => {
term = search;

View file

@ -106,7 +106,6 @@ function initSearchStore() {
packagesSearch,
postsSearch,
search: async (term: string) => {
searching.set(true);
try {
if (term) {
const [

View file

@ -14,6 +14,8 @@
};
export let placeholder = "search_";
export let autofocus = false;
let searchInput: HTMLInputElement;
let timer: NodeJS.Timeout;
@ -26,7 +28,7 @@
};
onMount(() => {
searchInput.focus();
if (autofocus) searchInput.focus();
Mousetrap.bind(["ctrl+shift+del"], function () {
searchInput.value = "";
return false;