onfocus or onFocus or onFocusIn?
It is probably not solid issue, but not sure which one to use.
I upgraded latest
solid-js
and onFocus
seems to be gone, not sure if it was even there before?
I tried to use onFocusIn
but it seem to work with playwright
but not vitest
i.e. fireEvent.focus
?
I tried to use onfocus
and it works well but it seems like generic html even handler, which is a bit out of place in middle of JSX.
I wonder how everyone handle this case?17 Replies
focusin|out
is delegated, focus
is not
and event names in on__
event handlers are case-insensitive (lowercased eventually) delegated or notThanks, I am not sure what is the norm, camelCase or lowercase? I has been using camel case for quite a while (I mean solid JSX used to have
onFocus
and it worked well) maybe I should convert everything to lowercase moving forward?i meant that they are transformed into lower case eventually by the compiler
Yeah I understand, sorry my question should probably be phrased as why
onFocus
is removed? (if I am not wrong)i think solid tries to align with dom conventions, ele.onclick = () => {}
but also provide onClick from other frameworks' conventions, as far as the types are concerned
Yeah I understand Ryan's intention here, it used to have
onFocus
, now it doesn't, so I am not sure if it is removed by mistake or something elseoh, you meant jsx types?
Yes
i was only talking about compiler and runtime
Apologies as my question wasn't too clear
i see, then maybe a change to differentiate delegated vs non
It still has
onfocusin
though
Maybe we should ask Ryan?
I quickly looked through the commits but didn't see anything suspiciousthe types come from ryansolid/dom-expressions
this happens to most of us 😆
it should be probably moved to solid-js in the future
Yeah seems to be this one https://github.com/ryansolid/dom-expressions/commit/5d0b08317f0136670e3dfb9e76c9a24a20b24de1
GitHub
Reorganize jsx-runtime html/svg type definitions (#191) · ryansoli...
* reorganize jsx-runtime html/svg type definitions
add jsdoc-like references to where each element comes from
add support template html field
add verify_types.ts file to add extra static check...
Reorganize
is a dangerous word 🥲
Thanks! @mdynnl 😃Ah interesting, thanks, I wonder why my vscode doesn't pick up 🤔
I am on solidjs
1.6.11