←back to thread

367 points lemonberry | 2 comments | | HN request time: 0s | source
Show context
macawfish ◴[] No.24641169[source]
I recently stumbled across "shoelace", which at a glance seems like an example of what the article is hoping for. It's a thoughtfully designed library of UI web components.

https://shoelace.style/

replies(3): >>24641310 #>>24641427 #>>24642064 #
ssorallen ◴[] No.24641427[source]
Thanks for the link. This library unfortunately highlights further challenges with Web Components like mixing custom WCs with native form elements. To use Shoelace form elements at all, you'll end up writing a bunch of JavaScript.

> Shoelace forms don't make use of action and method attributes and they don't submit the same was as native forms. To handle submission, you need to listen for the slSubmit event as shown in the example below and make an XHR request with the resulting form data.

> https://shoelace.style/components/form

replies(2): >>24642088 #>>24646202 #
1. domenicd ◴[] No.24642088[source]
This is fixable, using the form-associated custom elements feature that's specified in HTML. (Introduction: https://html.spec.whatwg.org/multipage/custom-elements.html#...)

However, that's only currently shipping in Chrome, despite the other browsers being positive on it.

Similar capability gaps that we're working to close are accessibility (https://html.spec.whatwg.org/multipage/custom-elements.html#..., same situation, everyone likes it, only Chrome ships so far) and focusability (https://github.com/w3c/webcomponents/issues/762, still figuring out what the solution should be).

replies(1): >>24644567 #
2. ssorallen ◴[] No.24644567[source]
That’s great, thanks for the links.