From 64b5d384ed544136e2c08a66b1e49c1c0beaea7b Mon Sep 17 00:00:00 2001 From: Ryan Hamamura <58859899+ryanhamamura@users.noreply.github.com> Date: Mon, 2 Mar 2026 23:05:11 -1000 Subject: [PATCH] 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. --- chat/components/chat.templ | 5 ++--- features/auth/pages/login.templ | 4 ++-- features/auth/pages/register.templ | 6 +++--- features/common/components/shared.templ | 2 +- features/lobby/pages/lobby.templ | 2 +- features/snakegame/pages/game.templ | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/chat/components/chat.templ b/chat/components/chat.templ index ec10136..f2d02fe 100644 --- a/chat/components/chat.templ +++ b/chat/components/chat.templ @@ -42,8 +42,7 @@ templ Chat(messages []chat.Message, cfg Config) { placeholder="Chat..." autocomplete="off" data-bind="chatMsg" - data-on:keydown.stop="" - data-on:keydown.key_enter={ datastar.PostSSE("%s", cfg.PostURL) } + data-on:keydown__stop={ "evt.key === 'Enter' && " + datastar.PostSSE("%s", cfg.PostURL) } /> } else { }