mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
fix: hide searchbox and bump to v0.0.25
This commit is contained in:
parent
4b2e303f71
commit
81745c2084
4 changed files with 6 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tea",
|
||||
"version": "0.0.24",
|
||||
"version": "0.0.25",
|
||||
"private": true,
|
||||
"description": "tea gui app",
|
||||
"author": "tea.xyz",
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -106,7 +106,6 @@ function initSearchStore() {
|
|||
packagesSearch,
|
||||
postsSearch,
|
||||
search: async (term: string) => {
|
||||
searching.set(true);
|
||||
try {
|
||||
if (term) {
|
||||
const [
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue