Replies: 1 comment
-
There are pull requests pending to update the checker with support for customizable select MananTank/validate-html-nesting#13 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone! Chrome 135 shipped with support for customizable select elements. It allows you to include rich HTML in
<select>
elements and have more styling options. An example of a typical DOM structure would be:The nice thing is that in browsers that do not support customizable select, the
button
element will be ignored and we fall back to an ordinary select.I tried using it in one project with solidjs, but ran into two issues:
The html-nesting checker still validates the previous rules (I already created an issue for that Support customizable select elements MananTank/validate-html-nesting#11)
Even if you disable the checker (for SolidStart set
solid.solid.validate
to false) rendering the above html snippet will throw with some_el$2 is null
error in browsers that to not support rich HTML in select elements, probably because solid wants to attach elements to thebutton
that won't be present in their DOM.The issue can be solved manually, by doing something like:
But I feel like this could be easily missed by developers especially when customizable select gets wider support. On the other hand, handling this as special case in solid would seem weird to me and I suspect some general solution to this problem would have some performance hit.
Note: I didn't post this as bug because I think it is intended that solid only works for valid html nesting and I am fine using the
<Show>
solution. But wanted to share it in case anybody comes up with a better solution.Beta Was this translation helpful? Give feedback.
All reactions