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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user