fix: use correct Datastar keydown event syntax
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user