Skip to content

Commit

Permalink
add search icon to tagging issues input
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed Mar 7, 2024
1 parent 440278a commit 8499625
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/IssuesTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
const pageSizes = [10, 20, 30, 40, 50];
let globalFilter = '';
let searchInput: HTMLInputElement;
const handleKeyUp = (e: any) => {
$table?.setGlobalFilter(String(e?.target?.value));
Expand Down Expand Up @@ -220,6 +221,7 @@
class="w-full bg-primary/5 px-5 py-2.5 text-sm focus:outline-primary dark:bg-white/5 dark:focus:outline-white"
bind:value={globalFilter}
on:keyup={searchDebounce}
bind:this={searchInput}
/>
{#if globalFilter}
<button
Expand All @@ -231,6 +233,15 @@
>
<i class="fa-solid fa-circle-xmark" />
</button>
{:else}
<button
class="absolute right-3 top-1/2 -translate-y-1/2"
on:click={() => {
searchInput.focus();
}}
>
<i class="fa-solid fa-magnifying-glass" />
</button>
{/if}
</div>
{#if $table.getFilteredRowModel().rows.length === 0}
Expand Down

0 comments on commit 8499625

Please sign in to comment.