fix(badges): focus search input when Search is triggered with too-short query
Pressing the Search button or Enter with fewer than the required min chars now focuses the input field instead of silently doing nothing, so the user gets clear feedback about where to type. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -56,7 +56,10 @@ let effective_min_chars = $derived.by(() => {
|
|||||||
|
|
||||||
function handle_search_trigger() {
|
function handle_search_trigger() {
|
||||||
const qry = (badges_loc.current.fulltext_search_qry_str ?? '').trim();
|
const qry = (badges_loc.current.fulltext_search_qry_str ?? '').trim();
|
||||||
if (qry.length < effective_min_chars) return;
|
if (qry.length < effective_min_chars) {
|
||||||
|
document.getElementById('badge_fulltext_search_qry_str')?.focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
badges_loc.current.search_version++;
|
badges_loc.current.search_version++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user