mirror of
https://github.com/vinta/awesome-python.git
synced 2026-11-20 06:40:51 +00:00
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:
parent
ebdda1367c
commit
cf804b5f78
3 changed files with 6 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue