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

@@ -20,7 +20,7 @@ templ LoginPage() {
type="text"
placeholder="Enter your username"
data-bind="username"
data-on:keydown.key_enter={ datastar.PostSSE("/auth/login") }
data-on:keydown={ "evt.key === 'Enter' && " + datastar.PostSSE("/auth/login") }
autofocus
/>
<label class="label" for="password">Password</label>
@@ -30,7 +30,7 @@ templ LoginPage() {
type="password"
placeholder="Enter your password"
data-bind="password"
data-on:keydown.key_enter={ datastar.PostSSE("/auth/login") }
data-on:keydown={ "evt.key === 'Enter' && " + datastar.PostSSE("/auth/login") }
/>
</fieldset>
<button