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:
+5
-1
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user