Cherry-pick the good stuff from input-per-letter

This commit is contained in:
Lynn 2022-01-14 17:19:42 +01:00
parent 687f2acc22
commit a688c30427
4 changed files with 8 additions and 5 deletions

View file

@ -73,7 +73,9 @@ function Game(props: GameProps) {
setGuesses((guesses) => guesses.concat([currentGuess]));
setCurrentGuess((guess) => "");
if (currentGuess === target) {
setHint("You won! (Enter to play again)");
setHint(
`You won! The answer was ${target.toUpperCase()}. (Enter to play again)`
);
setGameState(GameState.Won);
} else if (guesses.length + 1 === props.maxGuesses) {
setHint(
@ -170,7 +172,9 @@ function Game(props: GameProps) {
Give up
</button>
</div>
<table className="Game-rows">{tableRows}</table>
<table className="Game-rows" tabIndex={0}>
<tbody>{tableRows}</tbody>
</table>
<p role="alert">{hint || `\u00a0`}</p>
{/* <p role="alert" className="Game-sr-feedback">
{srStatus}

View file

@ -27,7 +27,7 @@ export function Row(props: RowProps) {
<td
key={i}
className={letterClass}
aria-live="polite"
aria-live={isEditing ? "assertive" : "off"}
aria-label={
isLockedIn
? letter.toUpperCase() +

View file

@ -44,7 +44,7 @@ export function clueWord(clue: Clue): string {
if (clue === Clue.Absent) {
return "no";
} else if (clue === Clue.Elsewhere) {
return "yellow";
return "elsewhere";
} else {
return "correct";
}

View file

@ -3743,7 +3743,6 @@
"neighborhood",
"fragments",
"symbolic",
"wales",
"designated",
"prescribed",
"electricity",