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,24 +50,23 @@ 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
const revealState = !revealed || isMainActorCell
? null
: attemptedLetter === ''
? null
: attemptedLetter === correctLetter
? 'correct'
: 'wrong';
: attemptedLetter === correctLetter
? 'correct'
: 'wrong';
return (
<LetterInput
key={colIndex}
rowIndex={rowIndex}
charIndex={charIndex}
highlighted={!revealed && charIndex === pos}
highlighted={isMainActorCell}
inputRef={setInputRef(charIndex)}
onNext={() => focusNextInput(charIndex, 1)}
onPrev={() => focusNextInput(charIndex, -1)}