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:
parent
ec0a5c5e08
commit
285b128bb8
|
|
@ -292,12 +292,12 @@ export function GameInfoPanel({
|
|||
const expectedLetter = currentRegionName[nextLetterIndex]?.toLowerCase()
|
||||
const pressedLetter = e.key.toLowerCase()
|
||||
|
||||
// Only accept single character keys (letters)
|
||||
if (pressedLetter.length === 1 && /[a-z]/i.test(pressedLetter)) {
|
||||
// Only accept single character keys (letters and space)
|
||||
if (pressedLetter.length === 1 && /[a-z ]/i.test(pressedLetter)) {
|
||||
if (pressedLetter === expectedLetter) {
|
||||
setConfirmedLetterCount((prev) => prev + 1)
|
||||
}
|
||||
// Ignore wrong letters silently (no feedback, no backspace needed)
|
||||
// Ignore wrong characters silently (no feedback, no backspace needed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue