Skip to content

Commit 107df97

Browse files
committed
Fix search results not clearing when search input is emptied
1 parent afc97c1 commit 107df97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/http/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h2 class="text-lg text-gray-500 max-w-xl mx-auto mb-8 text-balance">A modern, c
5252
</section>
5353
<section class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-10">
5454
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-2">
55-
<form id="filter-form" method="GET" action="/" hx-get="/packages-partial" hx-target="#package-results" hx-trigger="submit, change from:select" hx-push-url="false" hx-swap="innerHTML" class="flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 scroll-mt-16">
55+
<form id="filter-form" method="GET" action="/" hx-get="/packages-partial" hx-target="#package-results" hx-trigger="submit, change from:select, input from:[name=search] delay:300ms changed" hx-push-url="false" hx-swap="innerHTML" class="flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 scroll-mt-16">
5656
<div class="relative w-full sm:max-w-md">
5757
<svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>
5858
<input type="search" name="search" value="{{.Filters.Search}}" placeholder="Search packages..." class="w-full pl-9 pr-12 h-10 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-brand-primary/20 focus:border-brand-primary">

0 commit comments

Comments
 (0)