fix: use correct Datastar keydown event syntax
All checks were successful
CI / Deploy / test (push) Successful in 15s
CI / Deploy / lint (push) Successful in 25s
CI / Deploy / deploy (push) Successful in 34s

Replace invalid .key_enter and .enter modifiers with evt.key === 'Enter'
guard in the expression, per Datastar docs. Also fix __stop and __throttle
modifier syntax to use double underscores.
This commit is contained in:
Ryan Hamamura
2026-03-02 23:05:11 -10:00
parent 235e4afbe3
commit 64b5d384ed
6 changed files with 10 additions and 11 deletions

View File

@@ -34,7 +34,7 @@ templ GamePage(sg *snake.SnakeGame, mySlot int, messages []chat.Message, chatCfg
class="snake-wrapper flex flex-col items-center gap-4 p-4"
data-signals={ `{"chatMsg":""}` }
data-init={ datastar.GetSSE("/snake/%s/events", gameID) }
data-on:keydown.throttle_100ms={ keydownScript(gameID) }
data-on:keydown__throttle.100ms={ keydownScript(gameID) }
tabindex="0"
>
@GameContent(sg, mySlot, messages, chatCfg, gameID)