by chuckadams · 4mo ago · 0 comments
I didn't read any satire in the article at all, it just laid out all the built-in behaviors that a proper button has, and how much work it is to reimplement all of them. Something declarative and CSS-like would have been ideal for customizing elements, but instead we got the half-assed Custom Elements API and the completely different DX atrocity that is Web Components.
I can't really fault Custom Elements too much though, it's an imperfect API for an imperfect DOM and it's better than waiting forever for perfection. But I don't extend the same generosity to the Web Components spec.
But there is. You'll be so happy to learn about datalist today,
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_d...
It took forever but safari mobile got it right.
Extra fun to be had if you attempt to dynamically update the list.
Conclusion: utter garbage, stay away from it.
I just typed this by hand (lol) in 3-4 minutes:
https://jsfiddle.net/tjc4mpxe/
This is what we are waiting for? This is what is taking so long for browsers to support?