mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
Fix: search redirecting early and missing full tank names
**Enter key** - Enter redirected to the previous results' first tank while a search was still buffering, because the key handler captured a stale `searching` value. - Enter on an empty field redirected to the first tank of the unfiltered list (Sheridan). - The handler now reads live filter state and only acts when there is a settled search, matching the quick-link button. **Full names in search** - Search only knew short tank names, so queries like "super pershing" found nothing when the game stores a short form. - Add an optional `name_full` to `TankDefinition`, filled from the game's full name when a short name exists, and index it (plus an accent-stripped copy) in `fetchTankNames` / `SEARCH_KEYS`. - Displayed names are unchanged. Full names become searchable once the definitions are regenerated on the next build.
This commit is contained in:
1 parent
f3e8cdd5e0
commit
6153beced6
5 files changed
+39
-1
No files matched your search
@@ -46,7 +46,8 @@ export function SearchBar({ topResult, skeleton, onSelect }: SearchBarProps) {
|
||||
}, [searching]);
|
||||
const handleKeyDown = useCallback<KeyboardEventHandler>(
|
||||
(event) => {
|
||||
if (event.key !== "Enter" || !topResult || searching) return;
|
||||
if (event.key !== "Enter" || !topResult) return;
|
||||
if (!TankFilters.state.search || TankFilters.state.searching) return;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
Reference in new issue
Block a user