fix: keep main actor column highlighted on abandon

This commit is contained in:
thibaud-leclere 2026-04-11 12:52:13 +02:00
parent 2c5c9899bd
commit 253fdcf040

View file

@ -50,13 +50,12 @@ export default function GameRow({ actorName, pos, colStart, totalWidth, hintType
);
}
const isMainActorCell = charIndex === pos;
const attemptedLetter = typeof attemptedLetters?.[charIndex] === 'string'
? attemptedLetters[charIndex].toUpperCase()
: '';
const correctLetter = ch.toUpperCase();
const revealState = !revealed
? null
: attemptedLetter === ''
const revealState = !revealed || isMainActorCell
? null
: attemptedLetter === correctLetter
? 'correct'
@ -67,7 +66,7 @@ export default function GameRow({ actorName, pos, colStart, totalWidth, hintType
key={colIndex}
rowIndex={rowIndex}
charIndex={charIndex}
highlighted={!revealed && charIndex === pos}
highlighted={isMainActorCell}
inputRef={setInputRef(charIndex)}
onNext={() => focusNextInput(charIndex, 1)}
onPrev={() => focusNextInput(charIndex, -1)}