Skip to content

Commit

Permalink
Merge pull request #118 from hearchco/mk/fix/autofocus
Browse files Browse the repository at this point in the history
Changed autofocus
  • Loading branch information
aleksasiriski authored Feb 7, 2024
2 parents c46a1bf + f0a3bd2 commit 3abb2b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/lib/components/Searchbox.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
export let query: string;
export let autofocus: boolean = false;
</script>

<form
Expand All @@ -8,6 +9,7 @@
action="/search"
on:submit
>
<!-- svelte-ignore a11y-autofocus -->
<input
name="q"
class="mx-4 h-full w-full bg-transparent focus:outline-none"
Expand All @@ -18,7 +20,7 @@
spellcheck="false"
autocorrect="off"
dir="auto"
autofocus
autofocus={autofocus}
bind:value={query}
/>
<!-- <button
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<!-- this is hard fixed top space -->
<div class="mx-4 mb-4 mt-36 min-w-fit">
<img class="mx-auto h-40 w-40 mb-8 pointer-events-none" src={logo} alt="logo" />
<div class="mx-auto max-w-screen-sm"><Searchbox bind:query /></div>
<div class="mx-auto max-w-screen-sm"><Searchbox bind:query autofocus /></div>
</div>

0 comments on commit 3abb2b5

Please sign in to comment.