datastar
datastar copied to clipboard
key symbols in CamelCase handling quirkyness
The code will turn ArrowLeft into arrowleft. A - will turn the subsequent letter into a capital as noted in the docs, but that means we need to ask for key_-arrow-left instead of key_ArrowLeft or key_arrow-left. It's not super intuitive.
As seen here:
data-on-keydown.window.key_-arrow-left="console.log('left arrow')
Maybe we should make the keypress example print key codes to the screen when any key is pressed ? Kind of like https://www.toptal.com/developers/keycode
v0.21.0 changed so much, if this is still an issue open up against the new syntax which should be clearer.