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:
@@ -28,7 +28,7 @@ templ NicknamePrompt(returnPath string) {
|
||||
type="text"
|
||||
placeholder="Enter your nickname"
|
||||
data-bind="nickname"
|
||||
data-on:keydown.key_enter={ datastar.PostSSE("%s", returnPath) }
|
||||
data-on:keydown={ "evt.key === 'Enter' && " + datastar.PostSSE("%s", returnPath) }
|
||||
required
|
||||
autofocus
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user