fix(ui): keep input typable post-end so player can type restart/undo

Disabling the input via the disabled attribute blocks keydown events
entirely, so players couldn't type 'restart' or 'undo' after reaching an
ending. Switch to a CSS class for the faded visual state; the keydown
handler already restricts post-end input to those two commands.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 15:06:37 -05:00
parent e167979fa7
commit 5f8e3b1a34
2 changed files with 7 additions and 4 deletions
+5 -1
View File
@@ -34,7 +34,11 @@ if (!transcriptEl || !inputEl) {
}
const syncEndedUI = (): void => {
inputEl!.disabled = state.endedWith !== null
// Don't disable the input — the player still needs to type `restart` or
// `undo`. A `disabled` input rejects keydown events entirely. Use a class
// for visual styling instead; the keydown handler enforces the input
// restriction.
inputEl!.classList.toggle('ended', state.endedWith !== null)
}
const buildParserContext = (s: GameState): ParserContext => {