You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 the button 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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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