fix: shorten the search placeholder on phones

The full placeholder was cut off on narrow screens, e.g. "Search 529 projects across 74".

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-10-21 16:36:33 +08:00
co-authored by Claude
parent ebdda1367c
commit cf804b5f78
3 changed files with 6 additions and 0 deletions
+4
View File
@@ -12,6 +12,10 @@ const defaultSort =
: { col: "downloads", order: "desc" };
let activeSort = defaultSort;
const searchInput = document.querySelector(".search");
// The full placeholder is cut off on phones
if (searchInput && window.matchMedia("(max-width: 680px)").matches) {
searchInput.placeholder = searchInput.dataset.shortPlaceholder;
}
const noResults = document.querySelector(".no-results");
const rows = document.querySelectorAll(".table tbody tr.row");
const tbody = document.querySelector(".table tbody");
+1
View File
@@ -250,6 +250,7 @@
type="search"
class="search"
placeholder="Search {{ entries | length }} projects in {{ category.name }}..."
data-short-placeholder="Search {{ entries | length }} projects..."
aria-label="Search projects"
/>
</div>
+1
View File
@@ -112,6 +112,7 @@
type="search"
class="search"
placeholder="Search {{ entries | length }} projects across {{ total_categories }} categories..."
data-short-placeholder="Search {{ entries | length }} projects..."
aria-label="Search projects"
/>
</div>