fix(know-your-world): allow space in name confirmation input

The name confirmation feature (type first 3 letters) was rejecting
space characters, making it impossible to confirm names like
"New York" or "Sri Lanka".

Updated regex from /[a-z]/i to /[a-z ]/i to allow spaces.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-11-30 11:13:09 -06:00
parent ec0a5c5e08
commit 285b128bb8

View File

@@ -292,12 +292,12 @@ export function GameInfoPanel({
const expectedLetter = currentRegionName[nextLetterIndex]?.toLowerCase() const expectedLetter = currentRegionName[nextLetterIndex]?.toLowerCase()
const pressedLetter = e.key.toLowerCase() const pressedLetter = e.key.toLowerCase()
// Only accept single character keys (letters) // Only accept single character keys (letters and space)
if (pressedLetter.length === 1 && /[a-z]/i.test(pressedLetter)) { if (pressedLetter.length === 1 && /[a-z ]/i.test(pressedLetter)) {
if (pressedLetter === expectedLetter) { if (pressedLetter === expectedLetter) {
setConfirmedLetterCount((prev) => prev + 1) setConfirmedLetterCount((prev) => prev + 1)
} }
// Ignore wrong letters silently (no feedback, no backspace needed) // Ignore wrong characters silently (no feedback, no backspace needed)
} }
} }